From 88837443d2c74261eb665325a3b6f7efe93b524a Mon Sep 17 00:00:00 2001 From: Julian Haupt Date: Mon, 4 Nov 2024 15:39:37 +0100 Subject: [PATCH] chore(databases): add support for oracle 23ai (#4522) related to camunda/camunda-bpm-platform#4001 Backported commit 95ad993bb1 from the camunda-bpm-platform repository. Original author: tasso94 <3015690+tasso94@users.noreply.github.com> --- database/pom.xml | 14 +++++++------- .../bpm/engine/impl/db/sql/DbSqlSession.java | 4 ++-- .../ConnectionPersistenceExceptionTest.java | 3 ++- qa/test-old-engine/pom.xml | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/database/pom.xml b/database/pom.xml index 79ab913d37d..899cc7e75b0 100644 --- a/database/pom.xml +++ b/database/pom.xml @@ -19,7 +19,7 @@ 2.1.214 1.4.200 - 19.3.0.0 + 23.5.0.24.07 1.7.6 1.1.8 8.3.0 @@ -44,8 +44,8 @@ ${version.h2} - com.oracle.ojdbc - ojdbc8 + com.oracle.database.jdbc + ojdbc11 ${version.oracle} @@ -308,8 +308,8 @@ - com.oracle.ojdbc - ojdbc8 + com.oracle.database.jdbc + ojdbc11 test @@ -322,8 +322,8 @@ sql-maven-plugin - com.oracle.ojdbc - ojdbc8 + com.oracle.database.jdbc + ojdbc11 ${version.oracle} diff --git a/engine/src/main/java/org/operaton/bpm/engine/impl/db/sql/DbSqlSession.java b/engine/src/main/java/org/operaton/bpm/engine/impl/db/sql/DbSqlSession.java index cbf96475719..ee32ba74a61 100644 --- a/engine/src/main/java/org/operaton/bpm/engine/impl/db/sql/DbSqlSession.java +++ b/engine/src/main/java/org/operaton/bpm/engine/impl/db/sql/DbSqlSession.java @@ -659,13 +659,13 @@ protected List getTablesPresentInOracleDatabase() throws SQLException { Connection connection = null; PreparedStatement prepStat = null; ResultSet tablesRs = null; - String selectTableNamesFromOracle = "SELECT table_name FROM all_tables WHERE table_name LIKE ?"; + String selectTableNamesFromOracle = "SELECT table_name FROM all_tables WHERE table_name LIKE ? ESCAPE '-'"; String databaseTablePrefix = getDbSqlSessionFactory().getDatabaseTablePrefix(); try { connection = Context.getProcessEngineConfiguration().getDataSource().getConnection(); prepStat = connection.prepareStatement(selectTableNamesFromOracle); - prepStat.setString(1, databaseTablePrefix + "ACT_%"); + prepStat.setString(1, databaseTablePrefix + "ACT-_%"); tablesRs = prepStat.executeQuery(); while (tablesRs.next()) { diff --git a/engine/src/test/java/org/operaton/bpm/engine/test/persistence/ConnectionPersistenceExceptionTest.java b/engine/src/test/java/org/operaton/bpm/engine/test/persistence/ConnectionPersistenceExceptionTest.java index 0d448693c4d..cfcbafb1c9b 100644 --- a/engine/src/test/java/org/operaton/bpm/engine/test/persistence/ConnectionPersistenceExceptionTest.java +++ b/engine/src/test/java/org/operaton/bpm/engine/test/persistence/ConnectionPersistenceExceptionTest.java @@ -38,7 +38,8 @@ import org.junit.Rule; import org.junit.Test; -@RequiredDatabase(excludes = { DbSqlSessionFactory.H2 }) +// This test is excluded on Oracle since the SQL State changed with the new version of the JDBC driver. +@RequiredDatabase(excludes = { DbSqlSessionFactory.H2, DbSqlSessionFactory.ORACLE }) public class ConnectionPersistenceExceptionTest { @Rule diff --git a/qa/test-old-engine/pom.xml b/qa/test-old-engine/pom.xml index 56728008d4c..8b9ab54fe6c 100755 --- a/qa/test-old-engine/pom.xml +++ b/qa/test-old-engine/pom.xml @@ -90,6 +90,20 @@ + + oracle-23 + + + + maven-surefire-plugin + + true + + + + + + old-engine