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 Shantanu Sen <ss...@pacbell.net> on 2007/08/23 03:50:40 UTC

Axis2: ServiceClient.setCachingOperationContext question

In order to use the cleanupTransport method that has been added in ServiceClient in version 1.3, it seems we need to do a setCachingOperationContext(true) on the ServiceClient to have the getLastOperationContext return the MessageContext of the call that was invoked.

My question: what is the side-effect of setCachingOperationContext(true)? When/Why should this be used? 

In a production environment, the ServiceClient is expected to be invoked several times at a stretch depending on the traffic. To take care of such situation we should always reuse a fixed number of connections and/or most definitely close the connection once we are done with it - which is what the cleanupTransport does. If we follow the above logic, why should'nt the setCachingOperationContext be set to true by default when the ServiceClient is instantiated - i.e. why does the user need to set this explicity?

Can anyone throw some light on this?

Thanks,
Shantanu Sen



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: ServiceClient.setCachingOperationContext question

Posted by Deepal jayasinghe <de...@gmail.com>.
> In order to use the cleanupTransport method that has been added in ServiceClient in version 1.3, it seems we need to do a setCachingOperationContext(true) on the ServiceClient to have the getLastOperationContext return the MessageContext of the call that was invoked.
>   
Well , you do not need to set that , it will automatically store the
last operation context in the service context.
> My question: what is the side-effect of setCachingOperationContext(true)? When/Why should this be used? 
>   
As I said , it is redundant and I will deprecate that method.
> In a production environment, the ServiceClient is expected to be invoked several times at a stretch depending on the traffic. To take care of such situation we should always reuse a fixed number of connections and/or most definitely close the connection once we are done with it - which is what the cleanupTransport does. If we follow the above logic, why should'nt the setCachingOperationContext be set to true by default when the ServiceClient is instantiated - i.e. why does the user need to set this explicity?
>   
Well , according to Axis2 implementation ServiceClient is not thread
safe . Then we do not need to worry abt that issue (I guess)

Thanks
Deepal
> Can anyone throw some light on this?
>
> Thanks,
> Shantanu Sen
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>   


-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org