Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Life of Entity beans

 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Entity Beans survive critical failures like App server Crashing and Database Crashing".Please comment on it
Thanks
Vikas
 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kapil is right.
 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can 'reconnect' to the bean via its reference but it will be the state of the last committed transaction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic