[ 
http://issues.apache.org/jira/browse/AXIS2-1224?page=comments#action_12439728 ] 
            
Deepal Jayasinghe commented on AXIS2-1224:
------------------------------------------

Hmm , well when you deploy a service in application scope there will be only 
one instance of the service impl class so it wont be thread safe at all. The 
only solution is to store all the relevant properties and parameters in the 
service context , since there is only one service context for lifetime of the 
service.

So , when you deploy a service in application scope Axis2 can not make 
setOperationContext thread safe. In all the other scope it will be thread safe 
most of the time.

I think I will not be able to fix this issue.

> setOperationContext() not thread-safe
> -------------------------------------
>
>                 Key: AXIS2-1224
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1224
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: core, deployment
>    Affects Versions: 1.1
>            Reporter: Christopher Sahnwaldt
>         Assigned To: Deepal Jayasinghe
>            Priority: Blocker
>
> If a service has application scope, one service object is created per 
> application.
> When a request comes in, Axis calls the setOperationContext method, and the 
> service object may store the OperationContext or the MessageContext. Then 
> Axis 
> calls the actual service method, in which the service code can access the 
> stored
> OperationContext or MessageContext. But what if two requests come
> in almost simultaneously? The following sequence of method calls may occur:
> - Axis calls setOperationContext with context for request A, the service 
> object 
>   stores the context in an instance field.
> - Axis calls setOperationContext with context for request B, the same service 
> object 
>   stores the context in the same instance field and  thus *overwrites* the 
> context for call A.
> - Axis calls the service method with the input parameters for request A.
> - The service method processes the call, using data from the stored
>   context, and thus *mixes the input parameters for call A with the
>   context data for call B*. Anything can happen...
> - Finally, Axis calls the service method with the input parameters  for call 
> B, the service 
>   method processes the call, using data from the stored context, and thus 
> correctly uses 
>   the input parameters  for call B with the context data for call B. Probably 
> ok, unless 
>   the service method updated the context in some way during the call for 
> request A.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to