• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Methods that can be invoked in ejbCreate() of Entity Bean

 
VP Jain
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In HFE book pg 369 Question 9:

Which method(s) from the EntityContext interface can be invoked from

within the ejbCreate method?

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


The correct answers were stated as A,B,C,E.

But how can option "B" can be correct

coz in pg 338 the book states that

" it's too early to get a reference to your EJBObject or primary key, coz the container is still waiting for you to finish your ejbCreate().

Please correct me if i am wrong ?
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I marked the answer as A C E, as B cannot be the Answer .. it can invoke getEJBObject only after ejbCreate() ie in ejbPostCreate and beyond.

It must be a print mistake!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic