You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ivan Latysh <Iv...@yahoo.ca> on 2006/12/23 21:32:45 UTC

Concurrency in RPC Service with transportscope

Hello All,

  I submitted improvement request into JIRA (http://issues.apache.org/jira/browse/AXIS2-1911)
  And after I done some testing one more question arise.

  I have a simple RPC service with transportscope running on http port.
  So according to the doc's Axis will bound my service to the transport session, in my case it is HttpSession,
  and will use the same service for all requests within a session.

  So the question how is Axis handle concurrency when service implementation need to have an access to the session ?
  Because my proposed solution for AXIS-1911 is not thread safe without obtaining a monitor on service implementation.

  Is there are a way to notify implementation when it is bound to the session and unbound ?
  It will be most desirable behavior and thread safe.

-- 
Best regards,
 Ivan                          mailto:IvanLatysh@yahoo.ca


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


Re: Concurrency in RPC Service with transportscope

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi  Ivan ;
pls see my comment below;

>Hello All,
>
>  I submitted improvement request into JIRA (http://issues.apache.org/jira/browse/AXIS2-1911)
>  And after I done some testing one more question arise.
>
>  I have a simple RPC service with transportscope running on http port.
>  So according to the doc's Axis will bound my service to the transport session, in my case it is HttpSession,
>  and will use the same service for all requests within a session.
>  
>
Yes , the same service impl will be used to serve all the request coming
through that particular transport session.

>  So the question how is Axis handle concurrency when service implementation need to have an access to the session ?
>  
>
Axis2 handle that using Thread Local , where we store the message
context in side the the TL and service impl need to get the session
using MessageContext. Other than that Axis2 dose not handle any concurrency.

>  Because my proposed solution for AXIS-1911 is not thread safe without obtaining a monitor on service implementation.
>
>  Is there are a way to notify implementation when it is bound to the session and unbound ?
>  
>
Yes ,
when the session start it will call;
init(ServiceContext sc){
}

and when the session finishes;
destroy(ServiceContext  sc){
}

You can add those two methods into your service impl class , then those
will be called using java reflection.

Thanks
Deepal

>  It will be most desirable behavior and thread safe.
>
>  
>




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