Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing EJBObject from ejbCreate for stateless session beans  RSS feed

 
Gopi Donthireddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand one can access the EJBObject of a bean via the sessionContext from methods like ejbCreate(). But I am just wondering if it makes sense in case of stateless session beans. The bean is created at an unrelated time and hooked up with an arbitrary EJBObject on which a business method is called. Moreover at the time of ejbCreate() call, it's not yet linked to any EJBObject. It's just abt to be placed in the pool.

Do we encounter any exception if we try to do this?
 
Pranav Shukla
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't get any exception if you try to call getEJBObject in ejbCreate method of a SLSB.

This thread might help you. See Peer's reply.

Operations allowed in the methods of a stateless session bean.
 
Gopi Donthireddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merci...makes sense.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!