hoping someone can set me straight on this. When exactly would you
find a need to synchronize a method that accesses a session attribute?
When would a session attribute not be thread safe? If each session is
unique with unique attirbutes how are these attibutes not thread safe?
Thanks gurus
masseyke - 20 Mar 2006 20:47 GMT
> hoping someone can set me straight on this. When exactly would you
> find a need to synchronize a method that accesses a session attribute?
> When would a session attribute not be thread safe? If each session is
> unique with unique attirbutes how are these attibutes not thread safe?
One way is if the person browsing your website opens a new browser
window using ctrl-N in Internet Explorer. In that case, both the
original window and the new window will share the original session, and
it's fairly easy for those two browser windows to simultaneously submit
a request.
Thomas Hawtin - 20 Mar 2006 22:33 GMT
> hoping someone can set me straight on this. When exactly would you
> find a need to synchronize a method that accesses a session attribute?
> When would a session attribute not be thread safe? If each session is
> unique with unique attirbutes how are these attibutes not thread safe?
Given that sessions can be distributed over a number of JVMs,
"synchronize" isn't going to help you.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/