[ 
http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_61429 ]
     
Tim Kagle commented on AXIS-1754:
---------------------------------

As far as I recall the service is not thread safe. Previous call should 
probably mean the last call made by the service, that would be more useful.

Currently it comes from the service because you can't get it from the Stub, the 
API is Service.getCall(). So if you don't create the Call yourself but use the 
Stubs, there's no way to get to the call except for Service.getCall()

I'm not against getting rid of previousCall from the Service as it has 
threading issues hence my bug.

I think the Axis client needs some overhaul so it allows for session sharing, 
this being the reason which prompted my hackish approach to get to the session 
cookies.

> 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

Reply via email to