axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alef Arendsen (JIRA)" <>
Subject [jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static
Date Wed, 16 Feb 2005 17:30:04 GMT
     [ ]
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!

Alef Arendsen

> Service ThreadLocal previousCall should not be static
> -----------------------------------------------------
>          Key: AXIS-1754
>          URL:
>      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:
If you want more information on JIRA, or have a bug to report see:

View raw message