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

regarding ejbHome object reference in setEntityContext

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

If Container is going to make Entity bean instances and setSessionContext is called before Client interacts with Home object. How can we get reference of Home object in setSessionContext?

I have read that you can get Home object reference in setEntityContext in HFEjb book.
 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question...
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, yes another good question

It's just up to the Container to provide a bean with a reference to its own Home. The Home isn't tied to the *Client*, it's tied to the *Deployment*, so when a bean type (say, Customer bean) is deployed, a Home object (or something that *represents* a Home object... it's really up to the Container to implement it any way the vendor chooses, as long as it follows the behavior of the spec), is created so that any bean of that type that's created, whether in response to a client request or because the Container is pre-loading a pool, can have a reference to its Home... which is really the ONE and only ONE Home for all beans of that specific bean type (Customer, Cart, etc.).

So the Container doesn't need to wait until there is a Client... a Home is guaranteed to exist first, before any bean instances of that particular type are instantiated.

I hope I was answering the right question

cheers,
Kathy
 
raghu vadranam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kathy,

Thanks for the answer.

raghu
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic