axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davanum Srinivas (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static
Date Thu, 27 Jan 2005 04:20:17 GMT
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_58140 ]
     
Davanum Srinivas commented on AXIS-1754:
----------------------------------------

not really...clearCall needs to be static (can't change that!!) because we do Service.clearCall();
in AxisServlet. So prevCall can't be changed. Can you make a patch which keeps clearCall static
and make prevCall non-static, i'd really appreciate it.

thanks,
dims

> Service ThreadLocal previousCall should not be static
> -----------------------------------------------------
>
>          Key: AXIS-1754
>          URL: http://issues.apache.org/jira/browse/AXIS-1754
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2RC2
>  Environment: Axis 1.2RC2 on Linux
>     Reporter: Tim Kagle

>
> Regarding the Service and the use of the "static ThreadLocal previousCall"
> in the Service class, I think there is a problem with it.
> For example the following (pseudo) code running in the *same* Thread will
> not do what's expected:
> URL url = new URL("http://....");
> Service s1 = new Service(url);  // Service should be some FooService
>                                 // subclass but for simplicity let's call
>                                 // it Service
> s1.setMaintainSesison(true);
> Service s2 = new Service(url); // Same URL, same service, server, etc.
> s2.setMaintainSession(true);
> Stub stub1 = s1.getStub();
> Stub stub2 = s2.getStub();
> stub1.makeSomeCall(...);
> stub2.makeSomeCall(...);
> Call c = s1.getCall();
> This last statement will return the last Call made in this Thread, namely
> the call made on s2 rather than s1. I would expect it to return the last
> call made on s1 because that's what I called it on.
> This happens because the ThreadLocal previousCall is declared static in
> the Service.
> Is there a reason why the ThreadLocal cannot be a member variable of the
> Service intance rather than static? Could this be fixed?

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message