Chapter 6 - Entity Bean Synchronization - Mock Exam..
Ques 15 :
Which method(s) are always invoked in direct response to a client operation?
The choices are ejbLoad, ejbCreate, ejbremove, ejbActivate, ejbPassivate, setEntityContext..
The answers given in the book are : ejbCreate, ejbRemove..
But ejbActivate is called in response to a client operation..So shouldn't it be also an answer?Moreover, the comment given for that answer in that book says that Load, Passivate and setEntityContext can be called by the container when it wants it..Is it an errata in the book?
Ques 9 : Which method(s) from the EntityContext interface can be invoked from within the ejbCreate method?
The choices are : getEJBHome, getEJBObject, getCallerPrincipal, getUserTransaction, setRollbackOnly.
The answers given are : getEJBHome, getEJBObject, getCallerPrincipal, setRollbackOnly..But EJBOBject gets created only after ejbCreate method completes..So should the answer have getEJBObject??
In page no # 338, it says that "get a reference to your
EJB Object" is not allowed in ejbCreate..Please clarify..