wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Life Cycle Method True / False Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Life Cycle Method True / False" Watch "Life Cycle Method True / False" New topic
Author

Life Cycle Method True / False

Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
True / False

The life-cycle method PostConstruct, PreDestroy, PostActivation and PrePassivation are called only once for a Stateful Session Bean.

Please suggest


"Know where to find the solution and how to use it - that's the secret of success."
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi

I think that the PostActivation and PrePassivation can occur more than once, if you deal with an application server.

regards,
Mihai


SCJP, SCJD, SCWCD, OCPJBCD
Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Thanks Mihai
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10213
    
166

Just to be more clear, the PostConstruct and PreDestroy are called per "instance" of the stateful session bean.


[My Blog] [JavaRanch Journal]
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

Right.
Moreover the PrePassivation method is called each time when a statefull bean instance is passivated (serialized to temporary storage) and the PostActivate is called when the bean is activated (deserialized to bean instance).


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCEA/OCMJEA 5.0
 
 
subject: Life Cycle Method True / False