diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/locking/LockModeTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/locking/LockModeTest.java index a5561069ca..92d66edea5 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/locking/LockModeTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/locking/LockModeTest.java @@ -184,7 +184,6 @@ private void nowAttemptToUpdateRow() { it2.setValue( "changed" ); s.flush(); fail( "Pessimistic lock not obtained/held" ); - s.getTransaction().commit(); } catch ( Exception e ) { // grr, exception can be any number of types based on database @@ -197,9 +196,9 @@ private void nowAttemptToUpdateRow() { else { fail( "Unexpected error type testing pessimistic locking : " + e.getClass().getName() ); } - s.getTransaction().rollback(); } finally { + s.getTransaction().rollback(); s.close(); } }