• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

HFEJB Chap 6 Mock Exam Q9 p369

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,


Which method(s) from the EntityContext interface be invoked from within the ejbCreate method? (Choose all that apply.)

A. getEJBHome()
B. getEJBObject()
C. getCallerPrincipal()
D. getUserTransaction()
E. setRollbackOnly()



Answer as per the mock exam solutions - A,B,C,E

I think getEJBObject() cannot be called from ejbCreate method because the EJBObject for 'this' bean instance is still not associated with it. It can only be used after entering ejbPostCreate().

So the correct statements should be A,C,E.

Please give your thoughts on this.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your assessment is confirmed by the EJB 2.0 specification.

Chapter 10 Entity Bean Component Contract for Container-Managed Persistence
10.5 Instance life cycle contract between the bean and the container
10.5.5 Operations allowed in the methods of the entity bean class
Page 179 - Table 4.

However you may want to invest some time in updating the information in your copy of HF EJB with the information found in the confirmed errata (that one is already covered). And if you find something else check the unconfirmed errata.
[ October 13, 2005: Message edited by: Peer Reynders ]
 
Pranav Shukla
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peer, for your reply and reference to the exact page number in EJB 2.0 specification!
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, in HFEJB the spec reference is right beside the solution (see HF EJB p. 369, Q9).
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pranav

The confirmed errata list for HFEJB includes this question.

Errata
 
I like tacos! And this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!