File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Synchronized" method in Web Services

 
Jayakrishnan R Nair
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HI All,

I have a crazy question.

If I mark my web service method as "synchronized", will app server put all the web service requests in serial.

Means only one execution of the method takes place at a given time.

For normal threads or java application , that is the behaviour.

 
Vinod K Singh
Ranch Hand
Posts: 198
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be or many not. App server may create many instances of service implementation class to serve the class. All depends on how web service is exposed and using which framework. By default JAX-WS RI creates a singleton instance of the implementation class in that scenario everything may go in serial.
 
Gabriel Vince
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you may still get into trouble later, when you put your application into more server nodes.. the application will not be serialized anyway.
IMHO maybe you should not serialize request on the level of WS (vinod is right, a server may use as many service instances as it wishes), but maybe on the backend (as a sigleton service class, database level, ..)..

g.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic