You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ga...@jpmorgan.com on 2005/04/07 03:45:25 UTC
Generated Stubs and Thread Safe
Hello,
Are the generated stubs thread safe . Is
1. From invoke call stand point
2. From setting the properties
Is it advisable to Re-Use the same stub Object we need to create a new one
, per Thread, per Request.]
Thanks and Regards,
Gary Grewal
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates
Re: Generated Stubs and Thread Safe
Posted by "Tim K. (Gmane)" <tk...@ugcs.net>.
I asked the same question a while back and I was told that the Stub and
the Call are not thread safe, but they can be re-used from the same thread.
I'm not sure about the ServiceLocator, but if you want to maintain
multiple sessions for example, you need one instance of ServiceLocator
per session because the instance has an instance of the HTTP transport
object which holds the session cookie (if the session tracking is done
via cookies).
I'm not sure what happens if you use the same ServiceLocator from
multiple threads and get 2 or more Stub or Call instances and make
concurrent requests, you may end up blocking some threads because of
possible synchronization at the HTTP transport object.
I think the safe thing to do is have a ServiceLocator per thread and get
the Stub/Call from that.
This is definitely a topic that would be worth putting in the wiki, so
if someone who has the final answer could comment on it ...
Tim
gary.si.grewal@jpmorgan.com wrote:
> Hello,
>
> Are the generated stubs thread safe . Is
>
> 1. From invoke call stand point
> 2. From setting the properties
>
> Is it advisable to Re-Use the same stub Object we need to create a new one
> , per Thread, per Request.]
>
> Thanks and Regards,
>
> Gary Grewal
>
>
>
> This communication is for informational purposes only. It is not intended
> as an offer or solicitation for the purchase or sale of any financial
> instrument or as an official confirmation of any transaction. All market prices,
> data and other information are not warranted as to completeness or accuracy and
> are subject to change without notice. Any comments or statements made herein
> do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
> and affiliates
>
>