Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

sessions and synchronization

Thread view: 
javerra - 20 Mar 2006 20:27 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?

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/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.