This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic