Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

confusion on ejbCreate

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thank you so much Wei-ju Wu for providing this link.
 
I didn't say it. I'm just telling you what this tiny ad said.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic