tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: session.isNew() not thread safe?
Date Thu, 26 Feb 2009 16:48:51 GMT
Sort of (if I read the code correctly)

isNew is set to false after the response is finished. So if you have 2 
concurrent requests running, isNew is true until the first request 
finishes sending its response back to the client. Of course isNew could 
be set to false if the second request finishes its response faster than 
the first request. In which case, the first request could have isNew 
set=true only later have it be set to be false.


Jakob Ericsson wrote:
  > Our feeling is that this is a race condition between threads before
> tomcat set isNew to false.
> A quick workaround is to use request.getSession(false) and null
> checks. This seems to get us around our specific application problem.
> Could this be a problem in Tomcat?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message