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
posted
0
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.