This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Session Management question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Session Management question" Watch "HFSJ Session Management question" New topic
Author

HFSJ Session Management question

Tyronne Fernando
Ranch Hand

Joined: May 11, 2008
Posts: 50
Hi,

The following question from HFSJ 2nd edition page 271.

Which statements about HttpSession objects in distributed environments are true? (Choose all that apply.)

A. When a session is moved from one JVM to another, any attributes stored in the session will be lost.

B. When a session is moved from one JVM to another, appropriately registered HttpSessionBindingListener objects will be notified.

C. When a session is moved from one JVM to another, any session attribute implmenting the HttpSessionActivationListener interface will be notified.

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

C and D are given as correct answers. Isn't B correct as well? When a session migrates to a different JVM, isn't the attributes going to unbind from the session?

Thanks in advance.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Originally posted by Tyronne Fernando:
Hi,

The following question from HFSJ 2nd edition page 271.

Which statements about HttpSession objects in distributed environments are true? (Choose all that apply.)

A. When a session is moved from one JVM to another, any attributes stored in the session will be lost.

B. When a session is moved from one JVM to another, appropriately registered HttpSessionBindingListener objects will be notified.

C. When a session is moved from one JVM to another, any session attribute implmenting the HttpSessionActivationListener interface will be notified.

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

C and D are given as correct answers. Isn't B correct as well? When a session migrates to a different JVM, isn't the attributes going to unbind from the session?

Thanks in advance.


session is needed to be migrated to a different JVM because that JVM need to process a request from same client which the session is attached to. So those attributes bound to the session should be shipped with the session. Isn't it? They can't be unbound from the session. This is what I fell about it...
[ December 15, 2008: Message edited by: Vijitha Kumara ]

SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Tyronne Fernando
Ranch Hand

Joined: May 11, 2008
Posts: 50
That's how I understood after reading some of the other threads in the forum as well. Correct me if I am wrong.
liao Yang
Ranch Hand

Joined: Dec 27, 2006
Posts: 36
B is not correct. HttpSessionBindingListener are only notified when an attribute is bound/unbound to the session, they are not notified when the session migration happens.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFSJ Session Management question
 
Similar Threads
Session Migration and serialization
hfsj errata?
Session doubts
Listener question
Serializable (?) Objects associated to a session