Author: epbernard
Date: 2010-01-15 07:53:35 -0500 (Fri, 15 Jan 2010)
New Revision: 18562
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/TransactionImpl.java
Log:
HHH-4806 Wrap all .commit() exceptions in a RollbackException
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/TransactionImpl.java
===================================================================
---
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/TransactionImpl.java 2010-01-15
10:47:18 UTC (rev 18561)
+++
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/TransactionImpl.java 2010-01-15
12:53:35 UTC (rev 18562)
@@ -77,12 +77,9 @@
}
catch (Exception e) {
Exception wrappedException;
- if (e instanceof StaleStateException) {
- wrappedException = entityManager.wrapStaleStateException( (StaleStateException) e );
+ if (e instanceof HibernateException) {
+ wrappedException = entityManager.convert( (HibernateException)e );
}
- else if (e instanceof HibernateException) {
- throw entityManager.convert( (HibernateException)e );
- }
else {
wrappedException = e;
}
@@ -93,7 +90,7 @@
catch (Exception re) {
//swallow
}
- throw new RollbackException( "Error while commiting the transaction",
wrappedException );
+ throw new RollbackException( "Error while committing the transaction",
wrappedException );
}
finally {
rollbackOnly = false;
Show replies by date