Hi,
The servlet API leaves the job of synchronizing the access to an HttpSession
to the servlet programmer.
What is the philosophy which is employed to achieve this. Is it just
synchronizing on the instance of HttpSession returned by getSession method
or something more involved?
I wanted to know specifically if the following is the accepted method of
synchronizing the access to the session and is this widely followed?
==============
HttpSession objSession = req.getSession(false);
synchronized(objSession)
{
//set/get methods to be synchronized...
}
==============
I did check the archives. and I did find a lot of discussion on
synchronizing access to sessions but most of the post said that the user
should synchronize the access to the session, and the ones which did mention
a philosophy, the one stated above was mentioned.
I also found code for a wrapper that turns a Session into a Dictonary which
is synchronized but I think that solution is an overkill.
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