wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Life of Entity beans  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Life of Entity beans  " Watch "Life of Entity beans  " New topic
Author

Life of Entity beans

vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
"Entity Beans survive critical failures like App server Crashing and Database Crashing".Please comment on it
Thanks
Vikas


Thanks
Vikas Sharma
SCJP(1.4)
vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
While Entity bean is in transaction, and appserver crashes before appserver calls ejbStore()to persist data in persistence storage.
In that case how can we say entity bean survives crashes as modifications has not been updated in persistence storage? No doubt we would be able to load fresh data with new entity bean instance as soon as appserver revives again.
Similarly when database crashes while we are modifying any entity bean.
What do we really mean by "entity bean survives"?
thanks
Vikas
kapil Gupta
Greenhorn

Joined: Jan 31, 2002
Posts: 9
As per J2EE guidelines:
If the state of an entity bean is being updated by a transaction at the time of server crash, the entity bean's state is automatically reset to the state of the last committed transaction.
So in any case (Appserver or DBServer crashes), the transaction is rollbacked but bean itself is not destroyed and a client can later connect to the same Entity Bean using its object reference.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Kapil is right.


Groovy
vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
By saying that "a client can later connect to same Entity bean" do we mean state of previous instance is still managed ?

Originally posted by kapil Gupta:
As per J2EE guidelines:
If the state of an entity bean is being updated by a transaction at the time of server crash, the entity bean's state is automatically reset to the state of the last committed transaction.
So in any case (Appserver or DBServer crashes), the transaction is rollbacked but bean itself is not destroyed and a client can later connect to the same Entity Bean using its object reference.
Bill Dudney
Author
Ranch Hand

Joined: Sep 05, 2003
Posts: 234
You can 'reconnect' to the bean via its reference but it will be the state of the last committed transaction.


TTFN,<br /> <br />-bd-<br /> <br /><a href="http://www.amazon.com/exec/obidos/ASIN/0471449156/qid=1064343733/sr=2-1/ref=sr_2_1/002-8375300-3666449" target="_blank" rel="nofollow">Jakarta Pitfalls</a> | <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471146153/qid=1064343733/sr=1-2/ref=sr_1_2/002-8375300-3666449?v=glance&s=books" target="_blank" rel="nofollow">J2EE AntiPatterns</a> | <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471462071/qid=1064343733/sr=1-3/ref=sr_1_3/002-8375300-3666449?v=glance&s=books" target="_blank" rel="nofollow">Mastering JavaServer Faces</a> | <a href="http://bill.dudney.net/roller/page/bill" target="_blank" rel="nofollow">Blog</a> | <a href="http://www.jroller.com/page/BillDudney" target="_blank" rel="nofollow">Eclipse Blog</a> | <a href="http://www.sourcebeat.com/TitleAction.do?id=2" target="_blank" rel="nofollow">Eclipse 3 Live</a>
 
 
subject: Life of Entity beans