Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

InitialContext and Passivation  RSS feed

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes
 
Sandeep Prabhakar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
Can you explain me how? The InitialContext does not implement the Serializable Interface and the specs mentions only about SessionContext.

Cheers,
Sandeep
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sandeep Prabhakar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!