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 {
prepare();
Session sessionUnderTest = getSessionUnderTest();
sessionUnderTest.beginTransaction();
Silly silly = new Silly( "tester" );
sessionUnderTest.save( silly );
@ -257,8 +256,6 @@ public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunc
sessionUnderTest.delete( silly );
sessionUnderTest.flush();
sessionUnderTest.getTransaction().commit();
release( sessionUnderTest );
done();
}

View File

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