Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session migration

 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Can someone calrify this point

when session is migated its httpsession goes with it

as per my understanding session is not duplicated rest everything is duplicayted and new id is created on new JVM.
one session can not exist at two places simultaneously.

Please explain
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as far as i understood that topic a session is not duplicated across jvms ...

that means if a session needs to migrate, the session object and all it's attributes (which need to be serializable) are -well -serialized and shipped to the second jvm ...
so there is no copy of the session on the migrating jvm ...
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes thats waht my understanding says but mock test gives answer that

when session migrated httpsession goes with it.I think its incorrect

its from HFS 2ND EDITION page no-820 q-58
option B is correct



Can someone clear my doubt

Thanks
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have that book and i just checked the question ...

answer b is correct "When a session i migrated, its HttpSession goes with it" ...

that's exactly what we said ...

The HttpSession object is serialized and shipped to the second jvm, w/o having a copy left on the migrating jvm ...
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.....i got confused with session with httpsession object.
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question about this. So, when a session migrates, the only attributes it brings with it are the attributes that implement Serializable. So if an attribute does NOT implement Serializable, then the attribute is lost?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope.

the migration will fail .. all attributes will have to be serializable
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic