Friday, March 13, 2009

What should you do in a passivate method? (EJB)

Question :What should you do in a passivate method? (EJB)
Answer :You try to make all nontransient variables, which are not one of the
following to null. For the given list the container takes care of serializing
and restoring the object when activated.
Serializable objects, null, UserTransaction, SessionContext, JNDI contexts
in the beans context, reference to other beans, references to connection
Things that must be handled explicitly are like a open database connection
etc. These must be closed and set to null and retrieved back in the activate

No comments: