JBoss development,
A new message was posted in the thread "Parallel invocations of JaxWS services and
getPort":
http://community.jboss.org/message/526265#526265
Author : Richard Opalka
Profile :
http://community.jboss.org/people/richard.opalka@jboss.com
Message:
--------------------------------------------------------------
Hi Andrew,
this is the problem of *broken by design JAX-WS specification*
*Explanation:*
One of the problems when reusing proxy concurently is JAX-WS specification allows you
to set invocation related properties on the proxy using BindingProvider methods. Consider
the following code:
public void configureSession(EchoService serviceProxy, boolean keepSession)
{
BindingProvider bp = (BindingProvider)serviceProxy; bp.getRequestContext().put(
BindingProvider.SESSION_MAINTAIN_PROPERTY, keepSession );
}
If you would call above method on one proxy instance in e.g. 2 threads concurrently and
each thread will set different keepSession policy, how would you implement this properly
for the following scenario?
thread1.configureSession(proxy, true);
thread2.configureSession(proxy, false);
thread1.callService(proxy);
thread2.callService(proxy);
assertThereAreSessions(thread1);
assertThereAreNoSession(thread2);
Do you see what I mean?
*Suggestion:*
Create/use service proxy per thread, not reuse it for multiple threads
*Related issues:*
https://jira.jboss.org/jira/browse/JBWS-1519
https://jira.jboss.org/jira/browse/JBWS-2192
https://jira.jboss.org/jira/browse/JBWS-2681
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/526265#526265