• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stateless session bean ejbCreate()

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is it that a stateless session bean can access it's EJBObject from it's ejbCreate() method? Judging by its lifecycle, the EJBObject is created when the client invokes create(), and the bean itself is created when ever the container feels like it.

Is it that the container allows it to access a temporary EJBObject or something?

Regards.
 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the ejbCreate method is called, already newInstance and setSessionContext methods are executed.. So new object is created and its assigned with SessionContext. When you use SessionContext to get EJBObject in ejbCreate, you get the object which would be the same as returned by create method of Home object.
Please correct me if i am wrong

Makesh
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!