• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

HFEJB doubt in Question (EntityBean's ejbCreate() )

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right.
B cannot be the answer.
We cannot call getEJBObject() in ejbCreate() of entity bean.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
better guys see the errata.
you will know whats the printing mistakes.
it is here
in my opinion head first is way too good than mannings.
 
reply
    Bookmark Topic Watch Topic
  • New Topic