tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17615] New: - getSession() returns a different StandardSessionFacade object every time it is called
Date Mon, 03 Mar 2003 19:23:52 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17615>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17615

getSession() returns a different StandardSessionFacade object every time it is called

           Summary: getSession() returns a different StandardSessionFacade
                    object every time it is called
           Product: Tomcat 4
           Version: 4.1.12
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jay-paulsen@uiowa.edu


I posted this on the tomcat dev mailing list, but didn't get a response 
indicating if this is a bug or working as designed.  So I thought I'd try 
submitting it as a bug.


Environment:
Tomcat 4.1.12
Apache 2.0.43
Warp Connector 
Struts 1.1b2

Calling getSession() on the request object (which in this environment is an
instance of HttpRequestFacade which wraps a WarpRequest) creates and returns
a new StandardSessionFacade object that actually wraps another
StandardSessionFacade object which wraps the StandardSession object.  This
means that every call to request.getSession() returns a different
StandardSessionFacade object making it impossible to synchronize on the
session object.  

It looks like that the code in HttpRequestFacade.getSession() that wraps the
session in another StandardSessionFacade object is unneeded, possibly.  The
call it makes to StandardSession.getSession() already returns a session
object wrapped in a facade object.  

The Action.isTokenValid() method in Struts has a synchronized block on the
session object.  It looks like that this code would not work on Tomcat
because of this scenario.

I also quickly looked at Tomcat 4.1.18 and Struts 1.1rc1 and the code in the
above mentioned objects looks the same.  The CoyoteRequestFacade class used
by the Coyote Connector does the same thing too.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message