• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Beans Callback methods?

 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm referring to these methods.

public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}

when and in what situation we need them? are they usually empty?

thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a long story
For example passivation for stateful beans.
You have to make sure that the instance variables are serializable, or set to null. And you usually do this in ejbPassivate.

You can use both ejbRemove and ejbPassivate to release some resources.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The methods -ejbactivate() and ejbpassivate() are always empty in SLSB. The good news is EJB 3.0 makes these methods optional
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!