Re: Thread safety in WSIF

Aleksander Slominski <[email protected]>
Newsgroups gmane.comp.apache.webservices.wsif.devel
Message-ID <[email protected]>
[email protected] wrote:

> The below mentioned IBM URL says that WSIF is not thread safe.
>  
> http://publib.boulder.ibm.com/infocenter/ws51help/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/rwsf_restrict.html
>  
> Do you think this is correct?

yes. in the same way as typical RPC stub is not multi-thread safe (or 
AXIS Call object)

> Can some of the WSIF developers throw some light on this?

generally speaking WSIFService is multi-thread safe and it acts as a 
factory and WSIFPort is not and it acts as a stub.

> <> If at all WSIF is not thread safe, which part of WSIF is not thread 
> safe and what work around needs to be done so that multiple threads 
> can use WSIF concurrently.

thread safety will depend on actual WSIF provider you use:
for AXIS: WSIFDynamicProvider_ApacheAxis acts as a factory (looks safe 
to share in multiple threads) and produces WSIFPort_ApacheAxis that 
wraps AXIS Call object (stub) that should be either not shared between 
multiple threads or if shared it must be assured that only one thread is 
accessing it exclusively
for local-java: WSIFDynamicProvider_Java acts as a factory (looks safe 
to share in multiple threads) and produces WSIFPort_Java and sharing 
will depend ultimately if the underlying java class is accessed through 
static or instance (i am a bit murky about details of it see yourself 
WSIFOperation_Java)

i have no idea for EJB, JMS or JCA (except i remember JCA was very 
restrictive) but you can check source code and make your own evaluation.

>  
> If caching of WSIFService is turned-on in WSIFServiceFactory (by 
> calling cachingOn(true)), do you think there could be any problems 
> when concurrent threads pass through WSIF.

caching of WSIFService* should be fine but i would avoid caching/sharing 
WSIF*Port*

HTH,

alek

-- 
The best way to predict the future is to invent it - Alan Kay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.