• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stateless beans allowed operations

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the container decides to create a new statless bean, it invokes the beans constructor, setSessionContext() method, and finally the ejbCreate() method, then places the bean in the pool for this bean type. At this point (creation), the bean is NOT tied to any EJBObject, so why is it that we're allowed to invoke getEJBObject() and getEJBLocalObject() in the ejbCreate method?

Regards.
 
Michael Valentino
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For session beans, stateless beans are not tied to an EJBObject at the time ejbCreate() is called. Hoever, an EJBObject exists for that type of stateless bean. Take a look at the Object interaction diagram in HFEJB, page 227. At time of creation, there exists an EJBObject for your statless bean, however it's not tied to a particular client.

Hope that answered your question.
[ May 30, 2006: Message edited by: Michael Valentino ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic