[jboss-user] [JBoss Web Services Development] New message: "Re: Parallel invocations of JaxWS services and getPort"
Andrew Dinn
do-not-reply at jboss.com
Mon Feb 15 07:04:44 EST 2010
User development,
A new message was posted in the thread "Parallel invocations of JaxWS services and getPort":
http://community.jboss.org/message/526321#526321
Author : Andrew Dinn
Profile : http://community.jboss.org/people/adinn
Message:
--------------------------------------------------------------
Ok, I'm beginning to get the message here: the EG obviously didn't do a very thorough job up to 2.1. What boggles me is that all these issues have been thought about when it comes to EJBs. Let's hope Alessio can resolve some of these problems.
The web servcie context and its uderlying message context is the specified way of passing state between handler and service bean so it is important to make this work efficiently. It is still possible to make accesses thread safe. Make the injected context is a single static wrapper instance which contains a ThreadLocal. Aroudn each call the Web Service code can install and then remove thread-specific implementation instances of the current service context. The wrapper can indirect API calls to these per-thread instances to retrieve thread specific data.
That avoids the need to synchronize the whole web method when all that is really required is thread-safe access to the underlying message context and, from there, data cached by the handler. This will significantly benefit throughput. This is +extremely+ important because your decision to use only a single bean is a serious potential bottleneck. Even if the bean itself does not contain any shared state it cannot employ the message context without synchronizing all service methods and hence serialising all calls. Obviously the handler and thread could use their own thread local to communicate data in a thread-safe manner. However, rather than require each application to replicate a mechanism already defined in the spec it would be better to make the specified mechanism work safely.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/526321#526321
More information about the jboss-user
mailing list