Skip to content

Commit 1e6fd93

Browse files
committed
Merge pull request hibernate#10 from Naros/steve_HHH-10664_fixSuppliedConnectionTest
Fix SuppliedConnectionTest failure.
2 parents 0d84eb7 + 21c93da commit 1e6fd93

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

hibernate-core/src/test/java/org/hibernate/test/connections/ConnectionManagementTestCase.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ public final void testManualDisconnectChain() throws Throwable {
234234
public final void testManualDisconnectWithOpenResources() throws Throwable {
235235
prepare();
236236
Session sessionUnderTest = getSessionUnderTest();
237-
sessionUnderTest.beginTransaction();
238237

239238
Silly silly = new Silly( "tester" );
240239
sessionUnderTest.save( silly );
@@ -257,8 +256,6 @@ public final void testManualDisconnectWithOpenResources() throws Throwable {
257256
sessionUnderTest.delete( silly );
258257
sessionUnderTest.flush();
259258

260-
sessionUnderTest.getTransaction().commit();
261-
262259
release( sessionUnderTest );
263260
done();
264261
}

hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ private void releaseConnectionProvider() {
6363
@Override
6464
protected Session getSessionUnderTest() throws Throwable {
6565
connectionUnderTest = cp.getConnection();
66-
return sessionFactory().withOptions().connection( connectionUnderTest ).openSession();
66+
Session session = sessionFactory().withOptions().connection( connectionUnderTest ).openSession();
67+
session.beginTransaction();
68+
return session;
6769
}
6870

6971
@Override

0 commit comments

Comments
 (0)