From 0a95ac7fa05e259219efc6d40a61d971bbf535f5 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Tue, 16 Jul 2024 22:18:29 +1200 Subject: [PATCH] Update tests for DB2 forUpdate() --- .../src/test/java/org/tests/basic/TestQueryForUpdate.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ebean-test/src/test/java/org/tests/basic/TestQueryForUpdate.java b/ebean-test/src/test/java/org/tests/basic/TestQueryForUpdate.java index 3eeecebc79..4c9f26b563 100644 --- a/ebean-test/src/test/java/org/tests/basic/TestQueryForUpdate.java +++ b/ebean-test/src/test/java/org/tests/basic/TestQueryForUpdate.java @@ -34,6 +34,8 @@ public void testForUpdate() { if (isSqlServer()) { assertThat(sqlOf(query)).contains("with (updlock)"); + } else if (isDb2()) { + assertThat(sqlOf(query)).contains("with rs use and keep update locks"); } else { assertThat(sqlOf(query)).contains("for update"); } @@ -105,6 +107,8 @@ public void testForUpdate_withLimit() { if (isSqlServer()) { assertThat(sqlOf(query)).contains("with (updlock)"); + } else if (isDb2()) { + assertThat(sqlOf(query)).contains("with rs use and keep update locks"); } else if (!isOracle()) { // Oracle does not support FOR UPDATE with FETCH assertThat(sqlOf(query)).contains("for update"); @@ -138,6 +142,8 @@ public void testForUpdate_when_alreadyInPCAsReference() { assertThat(sql.get(0)).contains("from o_order"); if (isSqlServer()) { assertThat(sql.get(1)).contains("from o_customer t0 with (updlock) where t0.id = ?"); + } else if (isDb2()) { + assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? with rs use and keep update locks"); } else { assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update"); }