This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes InitialContext and Passivation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "InitialContext and Passivation" Watch "InitialContext and Passivation" New topic
Author

InitialContext and Passivation

Sandeep Prabhakar
Ranch Hand

Joined: Dec 22, 2005
Posts: 59
Hey Ranchers,
Will the container be able to restore an instance variable that was previously stored with java.naming.InitialContext after passivation-activation?

Cheers,
Sandeep
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
yes
Sandeep Prabhakar
Ranch Hand

Joined: Dec 22, 2005
Posts: 59
Hey,
Can you explain me how? The InitialContext does not implement the Serializable Interface and the specs mentions only about SessionContext.

Cheers,
Sandeep
Shanmugam Karthikeyan
Ranch Hand

Joined: Aug 02, 2002
Posts: 58
Hi,

It is not required for a class to definetly implement java.io.Serializable interface in order to get passivated.

According to the spec it is a container's responsiblity to retain the
state of context during the passivation stage.The container is free to
select any technics.

Hope this answer helps you.


SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3
Nishant Verma
Ranch Hand

Joined: Jun 14, 2006
Posts: 41
Sandeep

It is responsibility of the Container to restore the following during ejbPassivate / ejbActivate mechanism. Container is free to use any technique : (In case u have not patented them

Ref to home and component interfaces, a ref to session context, jndi, user transaction, resource manager connection factory reference.

Do take a look @ object substitution features of the Java Serialization protocol. This states how to serialize an object even though it does not implement java.io.Serializable.

Cheers
Nishant


"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." - Mark Twain
Sandeep Prabhakar
Ranch Hand

Joined: Dec 22, 2005
Posts: 59
Hey Ranchers,
Thanks for you help. I guess I now understand passivation better .
Nishant, regarding patenting, I will for sure inform you when I plan to have one .

Cheers,
Sandeep
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: InitialContext and Passivation
 
Similar Threads
What is saved during EJB Passivation?
Serializable
Passivation
Entity Bean Passiavtion?
Stateful session bean persistance