Fix SuppliedConnectionTest failure.

This commit is contained in:
Chris Cranford 2016-04-26 19:22:39 -05:00 committed by Steve Ebersole
parent ebfab98f2e
commit 713263a71c
2 changed files with 3 additions and 4 deletions

View File

@ -234,7 +234,6 @@ public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunc
public final void testManualDisconnectWithOpenResources() throws Throwable { public final void testManualDisconnectWithOpenResources() throws Throwable {
prepare(); prepare();
Session sessionUnderTest = getSessionUnderTest(); Session sessionUnderTest = getSessionUnderTest();
sessionUnderTest.beginTransaction();
Silly silly = new Silly( "tester" ); Silly silly = new Silly( "tester" );
sessionUnderTest.save( silly ); sessionUnderTest.save( silly );
@ -257,8 +256,6 @@ public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunc
sessionUnderTest.delete( silly ); sessionUnderTest.delete( silly );
sessionUnderTest.flush(); sessionUnderTest.flush();
sessionUnderTest.getTransaction().commit();
release( sessionUnderTest ); release( sessionUnderTest );
done(); done();
} }

View File

@ -63,7 +63,9 @@ public class SuppliedConnectionTest extends ConnectionManagementTestCase {
@Override @Override
protected Session getSessionUnderTest() throws Throwable { protected Session getSessionUnderTest() throws Throwable {
connectionUnderTest = cp.getConnection(); connectionUnderTest = cp.getConnection();
return sessionFactory().withOptions().connection( connectionUnderTest ).openSession(); Session session = sessionFactory().withOptions().connection( connectionUnderTest ).openSession();
session.beginTransaction();
return session;
} }
@Override @Override