• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Question on stateless bean and it's ejbCreate()

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

I just read that the stateless session bean and the EJB object will only be tied when the client calls a business method on the EJB object, NOT when the ejbCreate method is called. Which also means, I am assuming, the session context is tied to the bean, but, the session context has no idea about the EJB object.
Then on the next page, I read that within the ejbCreate method, one can use the session context to access reference to the home and the ejb object.
What I did not understand is that, when the ejbCreate method has no link with the EJB object, how can one access the EJB object's reference from within the ejbCreate method? It's only after the business method is called, the container pulls a bean out of the pool and links it with the client's ejb object.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vijay,
The way stateless session beans create in the pool is kinda confusing and complex way.
Server supplies an EJBObject(dummy/fake) implicitly to create an instance since the bean won't be assigned a real EJBObject from a client till the client calls a business method.
Kathy Sierra explaied about it here in this forum sometime back ..I tried to find that discussion link but couldnt...if you look for the discusson with many replies probably you can find

But I am sure the question/topic you raised is very intriguing...

Thanks,
Ugender
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic