Skip to content

Commit 4301002

Browse files
committed
fix TX leak in testCommitReadTxException()
1 parent bc3484f commit 4301002

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/objectbox-java-test/src/main/java/io/objectbox/TransactionTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ public void testCommitAfterAbortException() {
176176
@Test(expected = IllegalStateException.class)
177177
public void testCommitReadTxException() {
178178
Transaction tx = store.beginReadTx();
179-
tx.commit();
179+
try {
180+
tx.commit();
181+
} finally {
182+
tx.abort();
183+
}
180184
}
181185

182186
/*

0 commit comments

Comments
 (0)