Marc Lefebvre wrote: > I am deploying a POJO webservice using Axis2 and Java2Wsdl, etc... > Its all working nicely, but in developing the java code of my > webservice I had some questions about HOW internally Axis works so > that I can be sure of some possible issues that may arise. > > Does Axis create a separate thread for each webservice call? I am > assuming yes at this point. Yes, each request is handle by a separate thread. In the case of SimpleHTTP Server we use Thread pool, and in the case of App server, we use the thread given by the app server. > > If so, then, in the webservice any data structure that is accessed by > these threads must be thread safe. Right? As long as you have written the code not to have class variables, then it would. Depending on the service scope we create different number of service class instances. For example, for request scope we create new service instance for each service scope, whereas for Application scope we have single instance of the service class.
> > So, for example, if I had a HashMap that gets populated, read, and > deleted by webservice calls, I need to use the concurrent libraries > version of this HashMap. Right? Otherwise there could be contention > issues. I think that would be a good idea. > > I am assuming the Axis framework does not provide ANY kind of > protection against concurrency issues. > > Are there any other issues I should keep in mind in developing the > webservice due to the architecture of Axis? I think stateless nature is something you need to keep in mind, do not try to store values in your service class, instead use different contexts provided by Axis2. Thanks, Deepal > > Thanks... > -- Thank you! http://blogs.deepal.org http://deepal.org
