[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: session.isNew() not thread safe?
From:       Tim Funk <funkman () joedog ! org>
Date:       2009-02-26 16:48:51
Message-ID: 49A6C7F3.8050100 () joedog ! org
[Download RAW message or body]

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.

-Tim


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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic