axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xinjun Chen" <xjchen...@gmail.com>
Subject Re: web services multithreading
Date Wed, 26 Jul 2006 15:27:52 GMT
Jeffrey,

Thank you for your explanation. I seems understand your question. But
I still have some doubts. The following query may make my question
clear.

I have built a web service and deployed into Axis. The scope is set as
"application". According to
<http://ws.apache.org/axis/java/user-guide.html#CustomDeploymentIntroducingWSDD>,
all the requests will be served by a singleton shared object. Does it
imply that all the service operations must use keyword "synchronized"
to make the operations thread-safe?

But I seldom see others use "synchronized" keyword with a service
operation. Why? Does it imply that those services without
"synchronized" operations are not thread safe?

If multiple clients invoke the same operation of a service, how can I
ensure the thread-safety?



Regards,
Xinjun

On 7/25/06, Guo, Jeffrey <jguo@tripos.com> wrote:
> All incoming clients requests are handled by your underlying web server
> with concurrent threads from a thread pool.  When you indicate
> application or request scope for your web service hosted in an axis
> server, it's axis engine's job to decide whether to instantiate a new
> service layer object to serve the request.
>
> -----Original Message-----
> From: Xinjun Chen [mailto:xjchen001@gmail.com]
> Sent: Monday, July 24, 2006 11:16 AM
> To: axis-user@ws.apache.org
> Subject: Re: web services multithreading
>
> Hi Christopher,
>
> Thank you very much for the detailed answers! :-)
>
> I have one more follow on question: Assume the service scope is set as
> "application", if there are multiple clients invoke the same operation.
> How will this be done?
>
> According to the meaning of "application" scope, then no multithreading
> is support. This really confused me.
>
> How to make web services scalable?
>
>
>
> Regards,
> Xinjun
>
> On 7/23/06, Christopher Sahnwaldt <chrisahn@gmx.net> wrote:
> > The answers all depend on the 'scope' that you set in your services
> > configuration. See http://ws.apache.org/axis/java/user-guide.html
> >
> >  > 1. At the runtime, if there are multiple clients invoke the
> > OperationA
> >
> > > concurrently, how it will be done internally?
> >
> > Your application server (Tomcat etc.) will use one thread for each
> request.
> > If scope is 'request', each request will be executed on a different
> > service object. If scope is 'application', all requests will be
> > executed on the same service object.
> >
> > > 2. I think there will be only one instance of ServiceA, right?
> >
> > If scope is 'request', a new object is created for each request.
> > If scope is 'application', the same object is re-used for all
> requests.
> >
> > > 3. Will there be one extra thread created when one invocation
> happens?
> >
> > The thread probably won't be created (it will come from a pool), but
> > that depends on your application server, not on Axis. The app server
> > will handle concurrent requests in concurrent threads.
> >
> > > 4. If the same client invokes the OperationA in two consecutive
> > > call, it is ensured that the first call will always be served before
>
> > > the second call?
> >
> > Short answer: Yes. Long answer: Yes, as long as the client uses HTTP
> > (or another synchronous protocol) and does not make the calls in
> > different threads.
> >
> > > 5. Is there any difference about this multiple invocations in Axis2?
> > I don't understand the question...
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message