> Now... I believe that we do not need to synchronized the session object
> since every request is a sperate thread which contains its own request and
> response object. Thus a separate instance of the request object which
means
> a separate instance of the session object.

There is a seperate instance of request and response object but not
necessarily of the session object.


>The individual thread will be
> the only one accessing the session object. We do not need to protect the
> call to the session object.

This is not correct. There can be two threads accessing the same session
object. For example if you open two windows in the browser and send requests
from the two windows, then you may end up with two concurrent requests
dealing with the same session object.
This is mentioned in the specs for 2.2 version section 7.7.1
<snipped>Multiple servlets executing request threads may have active access
to a single session object at the
same time. The Developer has the responsibility to synchronize access to
resources stored in the
session as appropriate.</snipped>

> Best Regards
>
> Marc

Regds,
Gokul

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to