axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Kagle (JIRA)" <>
Subject [jira] Commented: (AXIS-1754) Service ThreadLocal previousCall should not be static
Date Thu, 27 Jan 2005 05:43:17 GMT
     [ ]
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:
>      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