Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTPSession and Serializable

 
Karthik Prabu
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a good practise to make all the Objects stored in the HTTPSession as Serializable ?

Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
Doing so allows you to restart the server and keep all of your session data. It will also be necessar if you want to run your app in a clustered environment with session replication.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how servlet container (any you know) behaves when some session entries can't be stored. Does it abort entire process or just skip "bad" entries?
 
Ragu Ram
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about all App servers. But Weblogic (atleast 8.1 and above) skips the bad entries as you had mentioned. It also gives a log on the console saying something like 'non serializable content present in session'.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, it's nice to hear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic