• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Migration Pg 269 HFSJ

 
Nishant Dhar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pg 269 HFSJ Q12

D is also a correct choice for Q12

From what i understood, even if an attribute implements Serializable, the instance variables of the attribute class may not survive migration since the readObject and writeObject methods are never called by the container/

So isnt there a chance that an attribute class that implements Serializable but not HttpSessionActivationListener may not be transferred (or maynot be transferred properly) to the new JVM

So how can D be correct.

maybe I havent understood something properly :-)
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you post the question please ?

Thanks
 
Nishant Dhar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q) Which statements about HttpSession objects in distributed environment is true?

A) When a session is moved from one JVM to another, attribute values that implement java.io.Serializable will be transferred to the new JVM

i think the above is not correct. can anyone explain this option to me
 
Ner min
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a session is moved from one JVM to another all attributees r moved too anyway.

So it is up to you do you make u'r att's implement java.io.Serializable or not. If u not u might not get waht u have accepted, becouse the container is not responsible to take care for u.

The question is a bit tricky couse it makes u to much pay attention on Serializable or not. BUT the point is that doesnt metter.

imo when a session is moved from one JVM to another ALL ATTs R MOVED, serializable or not.

please someone corret me if im wrong
 
Nishant Dhar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok .. so I understand that all the attributes move anyway when there is a session migration. however the instance variables of those attributes that are not serializable will be lost/destroyed which implement Serializable but do not implement HttpSessionActivationListener

am i correct ???
 
Ner min
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes but that was not the question
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic