Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why can I get a ref to EJB Object from ejbCreate

 
Caoimhin Breathnach
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I've looked through the head first book and a lot of the spec, and while it says you can get a reference to the EJB Object from ejbCreate() in a stateless session bean, I would love to know how this is possible?

Thanks.
 
Jef Cumps
cowbird
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is indeed a confusing topic ! ;-)

For stateless SB's bean creation is independent from client calls, so the container creates the beans whenever it wants. And the container has to make sure (according to the specs) that every bean has 'some' EJBObject reference in ejbCreate()... even if no client asked for it.

The container can use whatever EJBObject from that bean type he wants, I guess, because since all stateless beans from a certain type are the same, the EJBObject references for beans of that type are also the same.

If I remember well, this discussion has already been posted on this forum a while ago, maybe you can try looking for that one if it still is not clear.. (if it ever will )

Greetz
 
Caoimhin Breathnach
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oopsyourright - I didn't notice the search button on the top.
There are 39 other mails on this topic!

Thanks for that - It kinda explains it - I guess we don't have to worry how the container gives a client access to any EJB object, we just have to accept that thats how it works!

Cheers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic