• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

HFEJB Chap 6 Mock Exam Q9 p369

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pranav

The confirmed errata list for HFEJB includes this question.

Errata
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic