Yes, I was referring to HttpSession object.

But I think that you answered my question already.  We got confused by the
Tomcat code.  It doesn't appear to me that the HttpSession object is
synchronized in Tomcat, but as you mentioned, the get and set attribute
methods of the HttpSession object are synchronized.

Thanks for the clarification.

Celeste

-----Original Message-----
From: Christopher K. St. John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 10:56 AM
To: [EMAIL PROTECTED]
Subject: Re: Does Tomcat Synchronize the Session Object???


"Haseltine, Celeste" wrote:
>
> 7.7.1 Threading Issues
>
>   ... The Developer has the responsibility to
>   synchronize access to resources stored in the
>   session as appropriate.
>

 This means that the objects that you put into the
session are your responsibility. If you put object
"foo" into the repository, and then two servlet
threads get "foo" out of the session and call
foo.bar() simultaneously, it's up to you to make
sure that foo.bar() is thread safe.

 The servlet container itself is always responsible
for making sure that HttpSession.get/setAttribute()
are thread safe.


> Does Tomcat handle the synchronization of the session
> object for you, ... ?
>

 The phrase "the session object" is confusing. Do
you mean the HttpSession object, or the objects that
you bind into the session using HttpSession
putAttribute(obj)?


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to