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

Session Attributes - thread safe ?

 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi This is my first post in SCWCD section....

I am reading HFSJ book and I am confused a little.

I would like to learn are session attributes thread safe?

In book the author says that they should be synchronized because the same client can send 2 same request with different browser windows at the same time ? is it true I know that when somebody open 2 window in the same browser you got 2 different session ? so how can it be ?

Thanks
[ December 01, 2008: Message edited by: Anut Walidera ]
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In book the author says that they should be synchronized because the same client can send 2 same request with different browser windows at the same time ? is it true I know that when somebody open 2 window in the same browser you got 2 different session ? so how can it be ?


IE: Press CTRL+N: This will open a new browser window but will maintain the same session.

Firefox: Press CTRL+TAB: This will open a new TAB but will maintain the same session.

Hence you need to synchcronize on session object before acessing or mutating session attributes.
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I didn't know it before ....

I got it!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic