• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HF EJB - Being an entity bean

 
Dixie Bickham
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking into the chapter "Being an entity bean" at this moment from the K&B Head First EJb book.
I was trying to find out what "things" I was able to do when an entity is being created.
According to the book on p.338 the reference to your EJB Object cannot be obtained because the actual entity has not been created. Rightly.
However at the end of this chapter, in question 9 one of the correct answers is getEJBObject().
Am I overlooking something or has something been overlooked?
[ November 17, 2003: Message edited by: Dixie Bickham ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't miss anything! This is an error in the book that, who knows how, made it past a gazillion reviewers. And it's a Big Error. The answer is incorrect, the stuff on page 338 IS correct. You cannot get a reference to your EJB object from within ejbCreate() (the reason is explained on page 338, as you saw) -- it's too early, because the Container is still waiting for YOU to return from that the Container needs to build (at least conceptually) the EJB object.
I think that qualifies you to be listed in the next printing of the book as a "brave early adopter". So if you write to me directly and tell me what name to put in the book, the next printing will probably happen in a few weeks!
kathy@wickedlysmart.com
cheers,
Kathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic