Multiple choice technology architecture

Which of the following call back method belongs to Entity bean?

  1. void setContext()

  2. void ejbLoad()

  3. void ejbDelete()

  4. void ejbEvict()

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

In EJB (Enterprise JavaBeans), ejbLoad() is a callback method specific to Entity beans that is invoked by the container to synchronize the bean's state with the underlying database. This method is called when the container needs to refresh the entity bean's state from persistent storage.

AI explanation

ejbLoad() is a callback method defined on the EntityBean interface (part of the EJB 2.x entity bean lifecycle), invoked by the container to synchronize the bean's state from the underlying persistent store. setContext() (actually setEntityContext) exists too but the exact signature void setContext() doesn't match the real EntityBean interface, and ejbDelete()/ejbEvict() are either misnamed or not real entity bean callbacks as listed.