• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic