• Post Reply Bookmark Topic Watch Topic
  • New Topic

session attributes thread safe?

 
Bhumika Thakkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are session attributes thread safe with or w/o SingleThreadModel?
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SingleThreadModel is deprecated. And, no, they're not thread-safe.
 
Bhumika Thakkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
even with SingleThreadModel, I dont see how they are thread safe. we could have 2 servlet instances both in one session. right?
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bhumika Thakkar:
even with SingleThreadModel, I dont see how they are thread safe. we could have 2 servlet instances both in one session. right?


Correct. There could still be multiple threads accessing the same exact session object.
[ May 06, 2005: Message edited by: James Carman ]
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!