Jari Worsley wrote:
>
> Session scope beans are available to a user and their browser session (I'm 99% sure
> that one session corresponds to connection from one browser program).
> So if a user has two browser windows open accessing pages on your site, then they
> can potentially create simultaneous requests that access the same bean in session
> scope. So session beans need to be thread safe.

Actually, one session corresponds to a set of requests from the same client within a
certain period of time (the connection between the client and server may be
closed and reopened, but the session remains).

But yes, a user with multiple browser windows can cause multiple requests
within the same session. Other cases are when you use frames where the
content of each frame is from a JSP page; the browser will request all frames
at roughly the same time so you have multiple requests in the same session.
And another is a user that keeps hitting the Submit button before the response
is delivered; every time a new request is made but the previous request may
still be executing.

Hans


> >      I don't understand why beans with session scope should be thread safe.
> > Could you explain this more in depth ? (With an example if possible ?)
> >
> >      Thanks in advance,
> >
> > Peter Collette
> >
> > ===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> > FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html


--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to