The fact that handlers are suppose to be stateless is the issue we ran into.. I had never read that anywhere, but instead learned it the hard way..
--- On Tue, 1/12/10, Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM> wrote:
From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Subject: Re: Thread safety of web service objects/proxies/ports
To: dev_at_jax-ws.dev.java.net
Date: Tuesday, January 12, 2010, 1:44 PM
I think the proxy returned by JAX-WS RI(but not required by spec) is
thread-safe as long as you don't change request context.
If you keep a proxy object per thread, that works well.
Can you explain the thread-safety issues.
Handlers are supposed to be stateless. How does your handler code look
like ?
Jitu
LeRoy Hall wrote:
> Nick,
>
> I found the same as you, however be careful when using Handlers. We
> ran into thread safety issues with our handlers.
>
> LeRoy
>
> --- On *Tue, 12/8/09, Nick Wilson /<nickwi_at_yahoo.com>/* wrote:
>
>
> From: Nick Wilson <nickwi_at_yahoo.com>
> Subject: RE: Thread safety of web service objects/proxies/ports
> To: dev_at_jax-ws.dev.java.net
> Date: Tuesday, December 8, 2009, 8:23 AM
>
> David,
>
> After doing some performance testing ourselves we settled on
> caching the service and getting a new port for each call. It
> performs well and is fine with multiple threads. Caching the port
> caused problems.
> Regards,
>
> Nick
>
>
> -----Original Message-----
> From: David Balažic <xerces9_at_gmail.com
> <http://us.mc1138.mail.yahoo.com/mc/compose?to=xerces9@gmail.com>>
> Sent: 08 December 2009 13:25
> To: dev_at_jax-ws.dev.java.net
> <http://us.mc1138.mail.yahoo.com/mc/compose?to=dev@jax-ws.dev.java.net>
> Subject: Thread safety of web service objects/proxies/ports
>
> (I'm trying my luck here as I got no reply on the users list)
>
> Hi!
>
> I googled and found this:
> http://forums.java.net/jive/thread.jspa?messageID=328373
>
> quote: "We need to know whether the service objects generated by
> wsimport (JAX-WS RI 2.0.1 and later versions), as well as the port
> objects returned by the getPort() methods of those service objects are
> thread-safe."
>
> So is there a definitive answer?
>
> I am doing a cleanup in our project and want to know:
> - can I reuse the same proxy object returned by a single getPort()
> call in multiple threads?
> or
> - can I at least call the getPortName() method javax.xml.ws.Service
> child from mulriple threads?
>
> We use tomcat 6.0.20 and jaxws-api-2.1.jar jaxws-rt-2.1.4.jar
> jaxws-tools-2.1.5.jar
>
> Regards,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jax-ws.dev.java.net
> <http://us.mc1138.mail.yahoo.com/mc/compose?to=dev-unsubscribe@jax-ws.dev.java.net>
> For additional commands, e-mail: dev-help_at_jax-ws.dev.java.net
> <http://us.mc1138.mail.yahoo.com/mc/compose?to=dev-help@jax-ws.dev.java.net>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jax-ws.dev.java.net
> <http://us.mc1138.mail.yahoo.com/mc/compose?to=dev-unsubscribe@jax-ws.dev.java.net>
> For additional commands, e-mail: dev-help_at_jax-ws.dev.java.net
> <http://us.mc1138.mail.yahoo.com/mc/compose?to=dev-help@jax-ws.dev.java.net>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: dev-help_at_jax-ws.dev.java.net