aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes regarding ejbHome object reference in setEntityContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "regarding ejbHome object reference in setEntityContext " Watch "regarding ejbHome object reference in setEntityContext " New topic
Author

regarding ejbHome object reference in setEntityContext

raghu vadranam
Greenhorn

Joined: Sep 01, 2004
Posts: 23
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.


Raghu Nadh<br />SCJP 1.2,SCBCD
Sekhar Kadiyala
Ranch Hand

Joined: Feb 17, 2004
Posts: 170
Good question...


PMP CSQA SCJP SCWCD SCBCD INS 21 INS 23
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
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

Joined: Sep 01, 2004
Posts: 23
Hi kathy,

Thanks for the answer.

raghu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding ejbHome object reference in setEntityContext