OK, so how do I fix this problem in my application? I can't figure it out.

Inside Tomcat, references to the hashmap in question are synchronized
on the hashmap object itself, StandardSession.attributes (see
org.apache.catalina.session.StandardSession). So if I want to *safely*
call session.setAttribute or session.getAttribute I have to make sure
the calls are synchronized on session.attributes. But I can't access
session.attributes - it's a protected field and I don't see a method
that returns it. So I cannot make my setAttribute calls synchronize
properly with Tomcat's code.

I don't see how I can work around this. Am I missing something? Or do
the Tomcat guys have to fix it?
-- 
Len

On 9/6/05, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
> > From: Arup Vidyerthy [mailto:[EMAIL PROTECTED]
> > Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
> >
> > Does this mean that all session.setAttribute() and
> > session.getAttribute() should always be synchronised
> 
> That's the conclusion I'm reluctantly coming to, if there is the
> possibility of multiple threads updating the same session
> simultaneously.  Luckily, you would think that most operations would
> really be request, not session, related.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to