Skip to content

Commit 2baff67

Browse files
Improve verifyReadCommitted to actually verify read committed
1 parent 707f6fe commit 2baff67

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/test/java/oracle/r2dbc/impl/OracleConnectionImplTest.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,24 @@ private static void verifyReadCommittedIsolation(
369369
awaitQuery(
370370
Collections.emptyList(), row -> 0, selectInSessionB);
371371

372-
// Now sessionA COMMITs and sessionB can now see the INSERT
372+
// sessionA COMMITs and sessionB can now see the INSERT
373373
awaitNone(sessionA.commitTransaction());
374374
awaitQuery(List.of("A"), row -> row.get("value"), selectInSessionB);
375+
376+
// Begin a new READ COMMITTED transaction with sessionA, then update the
377+
// row in sessionB, then verify that sessionA can only see the update
378+
// after sessionB commits
379+
awaitNone(publisherSupplier.get());
380+
awaitNone(sessionB.beginTransaction());
381+
awaitUpdate(1, sessionB.createStatement(
382+
"UPDATE verifyReadCommittedIsolation SET value = 'B'"));
383+
awaitQuery(List.of("A"), row -> row.get("value"),
384+
sessionA.createStatement(
385+
"SELECT value FROM verifyReadCommittedIsolation"));
386+
awaitNone(sessionB.commitTransaction());
387+
awaitQuery(List.of("B"), row -> row.get("value"),
388+
sessionA.createStatement(
389+
"SELECT value FROM verifyReadCommittedIsolation"));
375390
}
376391
finally {
377392
awaitNone(sessionB.close());

0 commit comments

Comments
 (0)