• 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!!
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!