Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Why can I get a ref to EJB Object from ejbCreate

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

I've looked through the head first book and a lot of the spec, and while it says you can get a reference to the EJB Object from ejbCreate() in a stateless session bean, I would love to know how this is possible?

Thanks.
 
cowbird
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This is indeed a confusing topic ! ;-)

For stateless SB's bean creation is independent from client calls, so the container creates the beans whenever it wants. And the container has to make sure (according to the specs) that every bean has 'some' EJBObject reference in ejbCreate()... even if no client asked for it.

The container can use whatever EJBObject from that bean type he wants, I guess, because since all stateless beans from a certain type are the same, the EJBObject references for beans of that type are also the same.

If I remember well, this discussion has already been posted on this forum a while ago, maybe you can try looking for that one if it still is not clear.. (if it ever will )

Greetz
 
Caoimhin Breathnach
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oopsyourright - I didn't notice the search button on the top.
There are 39 other mails on this topic!

Thanks for that - It kinda explains it - I guess we don't have to worry how the container gives a client access to any EJB object, we just have to accept that thats how it works!

Cheers.
 
You can't have everything. Where would you put it?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic