From e955435471ced8e6b3b54659160dd3e95114e206 Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Tue, 1 Aug 2023 23:27:01 +0900 Subject: [PATCH] Bump h2 from 1.4.197 to 2.2.220 (#5395) * Bump h2 from 1.4.197 to 2.2.220 - Additional fix * - add ifNotExists --- drools-persistence/drools-persistence-jpa/pom.xml | 4 +++- drools-traits/pom.xml | 4 +++- .../src/main/java/org/kie/test/util/db/PersistenceUtil.java | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drools-persistence/drools-persistence-jpa/pom.xml b/drools-persistence/drools-persistence-jpa/pom.xml index 1f5c962999b..4bcc800f2dc 100644 --- a/drools-persistence/drools-persistence-jpa/pom.xml +++ b/drools-persistence/drools-persistence-jpa/pom.xml @@ -29,7 +29,9 @@ - jdbc:h2:mem:test + + + jdbc:h2:mem:test;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE public diff --git a/drools-traits/pom.xml b/drools-traits/pom.xml index 0c54d810c03..382ec18c5aa 100644 --- a/drools-traits/pom.xml +++ b/drools-traits/pom.xml @@ -29,7 +29,9 @@ - jdbc:h2:mem:test + + + jdbc:h2:mem:test;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE public diff --git a/kie-test-util/src/main/java/org/kie/test/util/db/PersistenceUtil.java b/kie-test-util/src/main/java/org/kie/test/util/db/PersistenceUtil.java index fed72fed6f6..08f8d2488ab 100644 --- a/kie-test-util/src/main/java/org/kie/test/util/db/PersistenceUtil.java +++ b/kie-test-util/src/main/java/org/kie/test/util/db/PersistenceUtil.java @@ -148,7 +148,7 @@ public static PoolingDataSourceWrapper setupPoolingDataSource(Properties dsProps String jdbcUrl = dsProps.getProperty("url"); // fix an incomplete JDBC URL used by some tests if (jdbcUrl.startsWith("jdbc:h2:") && !jdbcUrl.contains("tcp://") && !jdbcUrl.contains("mem:")) { - dsProps.put("url", jdbcUrl + "tcp://localhost/target/./persistence-test"); + dsProps.put("url", jdbcUrl + "tcp://localhost/target/./persistence-test;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE"); } h2Server.start(); } @@ -168,7 +168,7 @@ private static Properties getDefaultProperties() { if (defaultProperties == null) { String[] keyArr = { "serverName", "portNumber", "databaseName", "url", "user", "password", "driverClassName", "className", "maxPoolSize", "allowLocalTransactions" }; - String[] defaultPropArr = { "", "", "", "jdbc:h2:tcp://localhost/JPADroolsFlow", "sa", "", "org.h2.Driver", + String[] defaultPropArr = { "", "", "", "jdbc:h2:tcp://localhost/JPADroolsFlow;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE", "sa", "", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "16", "true" }; if (keyArr.length != defaultPropArr.length) { throw new IllegalStateException("Unequal number of keys for default properties!"); @@ -247,7 +247,7 @@ public void start() { if (realH2Server == null || !realH2Server.isRunning(false)) { try { DeleteDbFiles.execute("", "JPADroolsFlow", true); - realH2Server = Server.createTcpServer(new String[0]); + realH2Server = Server.createTcpServer(new String[]{"-ifNotExists"}); realH2Server.start(); } catch (SQLException e) { throw new RuntimeException("Can't start h2 server db", e);