Forums Register Login

HF EJB - Being an entity bean

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 529 times.
Similar Threads
Worthness of Reading HF EJB Book ,for EJB3.0
Why use ejbpostcreate() after that ejbcreate()
Please Help
Bean Things are confusing !!
entity bean design for performance
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:16:09.