sessions and synchronization

J

javerra

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
 
M

masseyke

javerra said:
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.
 
T

Thomas Hawtin

javerra said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top