aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question from servlet spec Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "question from servlet spec" Watch "question from servlet spec" New topic
Author

question from servlet spec

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
From Java Spec/*******
Multiple servlets executing request threads may have active access to a single
session object at the same time.
*********************/
<b>please correct my understanding of the abave stmt<b>
In an distributed env...all the threads in the service method share the same sesion. So we haev to synchronize the session variable
tony lee
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
hi,
to make things easier, first take distributed env out of consideration. lets see why a session object is accessible to mutiple threads. we know session is built on application level. it's easy to see a session object is accessable for all requests in the application.
in a distributed enverioment, session management is more complex. i think info about a session object should be kept in an external storage, like ejb or database. note that synchronization is only effective in a single VM.


SCJP2, SCWCD
 
IntelliJ Java IDE
 
subject: question from servlet spec
 
Threads others viewed
EJB 3 Local Lookup not working with Weblogic 10.3 and JDK 1.6_05
JSTL: remove object from scope
JNDI referencing to JBoss
Caching remote reference
Database synchronization with Entity Bean
IntelliJ Java IDE