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 "Tim Kagle (JIRA)" <ax...@ws.apache.org> on 2005/01/27 04:47:17 UTC
[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static
[ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_58137 ]
Tim Kagle commented on AXIS-1754:
---------------------------------
Any update on this bug? The fix is trivial, it should take 1 min. to fix. Thanks.
> 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