Hi Friends, Please clarify one doubt: HFEJB - Page:364 Q#9 -------------------- Which Method(s)from ENtityContext interface can be invoked from whitin the ejbCreate method?(Choose all that apply) A. getEJBHome () B. getEJBObject () --------------> doubt here. C. getCallerPrincipal () D. getUserTransaction () E. setRollBackOnly ()
ANS. A. B. C. E.
Doubt: Can we call getEJBObject () from ejbCreate() ? As per my understanding and the page no. 338, EJBObject gets created after ejbCreate() and after the database insert. ejbPostCreate () can no doubt get the reference of EJBObject.
I would be thankful if somebody can clarify this doubt as I am going to take the exam very soon.
Absolutely write its only in ejbPostCreate() that yu can call getEJBObject() not in ejbCreate() The purpose of the ejbPostCreate() is to create a EJBObject and stamp the primary key to the EJBObject and the EntityContext. I will suggest referring to Paul Sanghera too
SCJP 5<br />Brainbench Certified in C++<br />PMP<br />Dallas,TX