• Post Reply Bookmark Topic Watch Topic
  • New Topic

Life Cycle Method True / False  RSS feed

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True / False

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

Please suggest
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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

regards,
Mihai
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mihai
 
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to be more clear, the PostConstruct and PreDestroy are called per "instance" of the stateful session bean.
 
Ranch Hand
Posts: 133
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!