You are using an EJB3.0 Stateful Session Bean for storing shopping cart information. You would like to invoke a particular method to store state data whenever bean passivates. What is the best way to achieve it?

  1. You must write ejbPassivate() method. Shift the logic to this method.

  2. Mention the method name in the deployment descriptor

  3. Use annotations

  4. There is no such facility in EJB3.0


Correct Option: C

Find more quizzes: