You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/11/06 11:40:16 UTC
DO NOT REPLY [Bug 4672] New: -
HttpSession attributes get lost or are temporarily unavailable
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=4672>.
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=4672
HttpSession attributes get lost or are temporarily unavailable
Summary: HttpSession attributes get lost or are temporarily
unavailable
Product: Tomcat 4
Version: 4.0.1 Final
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Normal
Priority: Other
Component: Unknown
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: markus.naeher@web.de
Problem:
Running my servlets, I sometimes get NullPointerExceptions when working with
objects I have just read from the HttpSession.
In at least one case, I am 100% sure that I did not remove the attribute:
This attribute is set after a successful login and afterwords it is only read.
There's only one place in my whole code that sets that attribute and many
places where it is read. The Exception occurs occasionally, unforseeable and at
any of the places where I read it.
But like usual, there are many other attributes that are set, removed, and read.
I guess it is a timing problem, because I have multiple threads working with
one session and maybe some attributes are temporarily unavailable while the
session reorganizes its internal storage (I guess it is a Hashtable or so)
after numerous add operations.
Workaround:
I am currently testing a modified version of my servlets with synchronized
access to the session attributes.
So far, the problem has not occured any more.
Proposed fix:
Synchronize access to the session attributes internally.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>