Multiple choice technology programming languages

What are the call back methods in Session bean?

  1. ejbCreate()

  2. ejbPassivate(),

  3. ejbActivate()

  4. All the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Session beans have callback methods that the container invokes at specific lifecycle points. ejbCreate() is called when a bean instance is created. ejbActivate() is called when a passivated bean is activated (moved from secondary storage to memory). ejbPassivate() is called when a stateful session bean is passivated (moved to secondary storage to conserve resources). All three are valid callback methods.