• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

confusion on ejbCreate

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a confusion on ejbCreate method of stateless session bean that is when container calls ejbCreate to create a bean for pool EJBObject is not created then how can one permitted to call getEJBObject() method on SessionContext in ejbCreate() method.

soni.
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Soni,

A good question you have asked. When we are deploying a bean the home object would be created and bind to a JNDIName in the JNDI NameSpace, like when creating a pool for particular stateless sessionbean, first it creates the ejbobject and ejblocalObject, then only container creates the pool.

Its upto container dependent only one or more ejbObject and ejblocalObject for a particular stateless session bean.

Because these objects are only present in server(If container provides only one ejbobject and ejblocalobject), we may thing like servlet(multi thread model).


I hope it will help you.
 
Soni Prasad
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx for the answer..
ok then it means every instance in a pool is having an EJBObject but when a client calls create method on stateless bean's home an EJBObject is created then will the chosen(from pool) EJB's EJBObject be replaced by the EJBObject created by the create call?
[ July 12, 2005: Message edited by: Soni Prasad ]
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
in fact this is a question which also bugged me for a while, thankfully, a search in this forum was pretty helpful, here is a very detailed answer by Kathy:

Link to Kathy's answer

To Kathy and Bert: you might want to include that answer as an addition to "there are no Dumb Questions" into HFEJB. I have looked up the spec and the javadoc and they really do not explain this topic well.
 
Soni Prasad
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much Wei-ju Wu for providing this link.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic