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/07 16:14:12 UTC

[jira] Created: (AXIS-1754) Service ThreadLocal previousCall should not be static

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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Steven Schwell (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_61428 ]
     
Steven Schwell commented on AXIS-1754:
--------------------------------------

What do you mean by "previous call"? last one created by the current thread or the last one created by the current Service instance? At the very least that should be well defined and described. and implemented accordingly.

In either case, I don't see why the user can't remember what the "previous" call was, if necessary, for whatever reason. It doesn't seem like a commonly required need. And it doesn't seem like a responsibility that the Service factory should take on. especially if it leads to a memory leak! I recommend that we deprecate this method.

> 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


[jira] Resolved: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=all ]
     
Davanum Srinivas resolved AXIS-1754:
------------------------------------

    Resolution: Fixed

Fixed in latest CVS.

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 K

>
> 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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Tim Kagle (JIRA)" <ax...@ws.apache.org>.
     [ 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Alef Arendsen (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_59263 ]
     
Alef Arendsen commented on AXIS-1754:
-------------------------------------

I assume this is going to be part of 1.2.

It might also be wise to backport the fix to 1.1 and create a bugfix release (I don't know if you guys do bugfixreleases or anything). AFAIK it also affects the previous version.

ThreadLocals should ALWAYS be cleared, especially when running in a multi-classloader, multi-threaded environment; otherwise upon reloading applications in for instance Tomcat, the application's classloader cannot be discarded!

regards,
Alef Arendsen

> 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Jarek Gawor (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_58202 ]
     
Jarek Gawor commented on AXIS-1754:
-----------------------------------

I added the clearCall() becuase ThreadLocal was used. If ThreadLocal can be dropped then clearCall() can also be removed. 


> 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Steven Schwell (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_61487 ]
     
Steven Schwell commented on AXIS-1754:
--------------------------------------

ok, so if previousCall is to be defined as the last Call created by the Service then it should be an instance variable, not a static ThreadLocal. 

Alternatively we can deprecate the ill-defined getCall() method and remove previousCall altogether.

In general the use of ThreadLocal in Axis should be reviewed because it causes memory leaks when used in a Thread pooled server environment.

> 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Tim Kagle (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_61427 ]
     
Tim Kagle commented on AXIS-1754:
---------------------------------

The previous call is useful in order to get the cookies out of it and set them on another stub to share them for example (see http://issues.apache.org/jira/browse/AXIS-986), though it could be deprecated if there's an alternate way to share sessions between different stubs.

> 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Steven Schwell (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_61424 ]
     
Steven Schwell commented on AXIS-1754:
--------------------------------------

What is Service.getCall() supposed to return anyway? It is not documented. Is it the last Call created by the current Thread? or the last Call created by the given Service factory? Or something else entirely?

It seems strange for the Service factory to be responsible for remembering previous Call creations. IMO, getCall() should be deprecated for 1.2 and the the previousCall variable deleted altogether.

> 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Tim Kagle (JIRA)" <ax...@ws.apache.org>.
     [ 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ 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


[jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static

Posted by "Tim Kagle (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1754?page=comments#action_58141 ]
     
Tim Kagle commented on AXIS-1754:
---------------------------------

Ah, I didn't notice that. I'll take a look at it and try to patch it but not in the next couple of weeks (other deadlines unfortunately).

> 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