I am reviewing the EJB 2.0 specification. Throughout the spec it refers to 'home' like in the following statements: 1) Every entity object has a unique identity within its home. 2) Alternatively, if a client obtains two entity object references from the same home, it can determine if they refer to the same entity by comparing their primary keys using the equals method. I don't understand what home means. It is not referring to the Home interface or container created class. Can anyone shed some light on this subject? Thanks in advance.
Hi Terry, I think the above talks about an instance of the bean among other instances, of the same bean, (who have the same "HomeInterface"). Also note that each deployment results in a distinct home so that holds withing a scope of the same deployment. This is only my understanding. What do other developers think? +Seid
Joined: Sep 29, 2000
So does Home refer to a deployed location? If I have two servers that are part of the same application and an EJB is deployed on both of the servers - there would be two distinct home(s)?
Originally posted by Terry McKee: So does Home refer to a deployed location? If I have two servers that are part of the same application and an EJB is deployed on both of the servers - there would be two distinct home(s)?
Hi Terry, Every EJB application consists of N Beans (Sesson, Entity, MDB). Each of those Beans (with exception of MDBs) gets a Home associated with it at the deployment time (that Home implements the home interface of the bean). This "home" is not location (host) dependent, it is EJB-Application dependent. That means you can have one "Home" that exists on 20 clustered servers or you can have many homes on one server. The home is a factory for the beans, so you can say that beans created by the same factory are equal if their primary keys are equal. Dragan
Please consider finding an error in my following statement regarding home and ejb objects. Home objects (always implemented by container) are factory for EJB objects which in turn instantiates entity beans or session beans.
Ashik Uzzaman Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.