aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Entity Object 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 "Entity Object Question" Watch "Entity Object Question" New topic
Author

Entity Object Question

Keith Rosenfield
Ranch Hand

Joined: Nov 25, 2003
Posts: 277
Hello all,
On page 48 of the spec you will find this statement:
The entity, its primary key, and its remote reference survive the crash of the EJB Container. If
the state of an entity was being updated by a transaction at the time the container crashed, the
entity�s state is automatically reset to the state of the last committed transaction. The crash is
not fully transparent to the client�the client may receive an exception if it calls an entity in a
container that has experienced a crash.

I don't fully understand this statement. I understand that the entity is the actual record in the database and that it will survive a crash. Is this the entity that is being referred to above? Does the entity bean also survive the crash and therefore any clients can call methods on the bean after the server has been re-started? What is meant by the primary key surviving? Does this mean the primary key class?
Please add anything else that may help shed some light on this.

Thanks,


Keith Rosenfield<br />SCJP<br />SCWCD<br />SCBCD
Tulsi Rai
Ranch Hand

Joined: Jun 26, 2002
Posts: 55
Hi Keith,
Originally posted by Keith Rosenfield:
Hello all,
On page 48 of the spec you will find this statement:

I don't fully understand this statement. I understand that the entity is the actual record in the database and that it will survive a crash. Is this the entity that is being referred to above?
Please add anything else that may help shed some light on this.

Thanks,

Yes, the entity that is being referenced there is the entity that is representing a row in a database.

Does the entity bean also survive the crash and therefore any clients can call methods on the bean after the server has been re-started?

I am not sure about this. I can't even come up with reason how the bean survives if the container where it lives crashes. I am not sure if the container has to create that bean and put it in the pool once it restarts so that clients can invoke methods on that bean. Please put your thoughts on it that makes it clear to us.

What is meant by the primary key surviving? Does this mean the primary key class?

I think, the reference to primary key could be a class, a column or combination of columns in a row in a database that is being represented by the bean. As far as it's survival is concerned, i believe, the value it is representing at the time of container crash gets saved in the storage.
i would like other to elaborate a little and confirm it.
thanks.
Keith Rosenfield
Ranch Hand

Joined: Nov 25, 2003
Posts: 277
Thanks Tulsi
Can anyone else shed some more light on this subject.

 
Don't get me started about those stupid light bulbs.
 
subject: Entity Object Question