Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

session.setAttribute for session persistence

 
david chan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a question about WAS 5 memory-to-memory session persistence:
If I have a user object stored in session in the begining the object created,
Do I need to call session.setAttribute each time the user object got updated, so that it will be updated on other node?
Thanks.
David
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, absolutely, positively. If you do not call setAttribute() it will most certainly NOT get updated. The same, by the way, applies for using a shared database as the session sharing mechanism -- if you don't call setAttribute() it won't get persisted!
Kyle
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
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!