I have an entity bean with a "id" property annotated by:
| @Id
| @GeneratedValue
|
However, when this transaction fails with a database level deadlock and is rolled back
(ie: EJBTransactionRolledbackException ...), the entity's "id" property is
not rolled back and still has the database generated id value that it was given before the
deadlock. So it essentially becomes a detached entity with no real backing value in the
database.
Shouldn't an entity bean's state be rolled back as well when the application TX is
rolled back? Is this a bug?
The rollback is initiated by a database deadlock and is described by the following
exception stack:
| javax.ejb.EJBTransactionRolledbackException
| javax.persistence.PersistenceException
| org.hibernate.exception.LockAcquisitionException: could not insert: ...
| java.sql.SQLException: Deadlock found when trying to get lock; try restarting
transaction
|
Let me know if you need more information to reproduce/investigate this...
Thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957915#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...