From 5071a82458bf4ff497e04d8c9bb7f896c892a7c5 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Fri, 30 Dec 2011 18:48:33 -0600 Subject: [PATCH] HHH-5275 - Criteria.setLockMode does not work correctly --- .../matrix/java/org/hibernate/test/locking/LockModeTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 @@ public class LockModeTest extends BaseCoreFunctionalTestCase { 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 @@ public class LockModeTest extends BaseCoreFunctionalTestCase { else { fail( "Unexpected error type testing pessimistic locking : " + e.getClass().getName() ); } - s.getTransaction().rollback(); } finally { + s.getTransaction().rollback(); s.close(); } }