Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 64171 invoked from network); 2 Mar 2003 00:33:47 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 2 Mar 2003 00:33:47 -0000 Received: (qmail 22440 invoked by uid 97); 2 Mar 2003 00:35:32 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@nagoya.betaversion.org Received: (qmail 22433 invoked from network); 2 Mar 2003 00:35:32 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 2 Mar 2003 00:35:32 -0000 Received: (qmail 63320 invoked by uid 500); 2 Mar 2003 00:33:39 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 63309 invoked from network); 2 Mar 2003 00:33:39 -0000 Received: from ns3.linuxwebnet.com (216.133.76.5) by daedalus.apache.org with SMTP; 2 Mar 2003 00:33:39 -0000 Received: (qmail 4057 invoked from network); 2 Mar 2003 01:20:12 -0000 Received: from adsl-216-102-196-220.dsl.snfc21.pacbell.net (HELO VAIO) (216.102.196.220) by shada.com with SMTP; 2 Mar 2003 01:20:12 -0000 From: "Filip Hanik" To: "Tomcat Developers List" Subject: RE: getSession() returns a different StandardSessionFacade object every time it is called Date: Sat, 1 Mar 2003 16:38:18 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-reply-to: Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N why don't you just synchronize on an object stored in your session, bada bim bada bom :) Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect www.filip.net >-----Original Message----- >From: Paulsen, Jay [mailto:jay-paulsen@uiowa.edu] >Sent: Saturday, March 01, 2003 11:04 AM >To: 'tomcat-dev@jakarta.apache.org' >Subject: getSession() returns a different StandardSessionFacade object >every time it is called > > > > >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. > >Am I completely missing something here? If this is the intended behavior, >is there another alternative to synchronizing on the session 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. > >Any insight on this is greatly appreciated. > >Regards >-Jay > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org