File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes 'HOME' question 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 " Watch " New topic
Author

'HOME' question

Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 173
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.
Seid Myadiyev
Ranch Hand

Joined: Jul 02, 2002
Posts: 196
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
Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 173
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)?
Dragan Milic
Ranch Hand

Joined: Oct 03, 2002
Posts: 31
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
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 'HOME' question