HHH-5275 - Criteria.setLockMode does not work correctly

This commit is contained in:
Steve Ebersole 2011-12-30 18:47:44 -06:00
parent f6dec69c8c
commit 2eac7c33ec
1 changed files with 2 additions and 1 deletions

View File

@ -184,6 +184,7 @@ public class LockModeTest extends BaseCoreFunctionalTestCase {
it2.setValue( "changed" ); it2.setValue( "changed" );
s.flush(); s.flush();
fail( "Pessimistic lock not obtained/held" ); fail( "Pessimistic lock not obtained/held" );
s.getTransaction().commit();
} }
catch ( Exception e ) { catch ( Exception e ) {
// grr, exception can be any number of types based on database // grr, exception can be any number of types based on database
@ -196,9 +197,9 @@ public class LockModeTest extends BaseCoreFunctionalTestCase {
else { else {
fail( "Unexpected error type testing pessimistic locking : " + e.getClass().getName() ); fail( "Unexpected error type testing pessimistic locking : " + e.getClass().getName() );
} }
s.getTransaction().rollback();
} }
finally { finally {
s.getTransaction().commit();
s.close(); s.close();
} }
} }