Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding ejbHome object reference in setEntityContext

 
raghu vadranam
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.
 
Sekhar Kadiyala
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question...
 
Kathy Sierra
Cowgirl and Author
Rancher
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic