There are actually several ways that the same user can access the same session object concurrently. Examples that I can think of are: 1) the easiest was is when web application uses a frameset in the browser. multiple frames can invoke servlets or jsps concurrently to fill in their respective "frames". 2) the end user gets impatient with response time (this never happens in my apps :) and hits the stop button and the refresh. In this case the first servlet request will most likely eventually get an io error trying to write the response.
-----Original Message----- From: Brian P Bohnet [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:28 AM To: [EMAIL PROTECTED] Subject: Re: Basic question: repeating code in JSP pages? I'm a little confused about sychronization of session. If each user has their own session object, where/what else would be modifying a particular session object? Perhaps an explanation of the scenario where synchronization is necessary is in order? Could you explain? thanks Brian Rafal Smyka wrote: > From: "Adrian Janssen" <[EMAIL PROTECTED]> > > returning arrays and objects that you create inside your function is fine, > > but if you must modify arrays / objects that you pass in you will have to > > syncronize on those objects before you modify them. Alternatively in the > > I would say all the object with life scope limited to request are thread > safe. > Synchronization is necessary only for modifications of shared ones, in > particular the ones from session. > > -- > Regards, > Rafal > > =========================================================================== > 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 ***************************************************************** DISCLAIMER: The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator. =========================================================================== 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
