Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question from servlet spec

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic