• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

calling getEJBObject() in ejbCreate() of Stateless session bean  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I dont understand how we can get reference to EJBObject in ejbCreate method for a stateless session bean. From what I understand, the stateless session beans are created by the container (for this the bean constructor is called and then setSessionContext, ejbCreate methods are called) and kept in pool. Till this point the bean is tied only to the context and not to any EJBObject. If this is the case, how can we call getEJBObject in ejbCreate method ? Please respond if you know the answer.

Thanks in advance.

Karthik
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This topic was already discussed in this forum a few days back. You may want to checkthis out.
 
Kaarthik Sivashanmugam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, Suman. The link you sent however did not clear my doubt. The link for the discussion you sent concludes that because getEJBObject() is possible in ejbCreate(), EJBObject should have been created before that. I could infer that while reading HFEJB. But, I am interested to know when (and how) EJBObject creation happens for stateless session bean in relation to ejbCreate(). If I have to go with the OID in page 227 of HFEJB ejbCreate is possible in a "different/unrelated" time. So it can happen before or after the "client call" create(). If it happens before the "client call". EJBObject would not have been created during ejbCreate().

Also, another related question is, if every client creates a new EJBObject, does it mean that ejbCreate is called for every client? I assume it is not. As a result, if ejbCreate can access EJBObject, which client's EJBObject are we talking about ?
 
Kaarthik Sivashanmugam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vipin. That was really helpful.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:-) So that's what the spec says karthik
Thanks Vipin
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!