diff --git a/drools-persistence/drools-persistence-jpa/pom.xml b/drools-persistence/drools-persistence-jpa/pom.xml index 66a11c10bb3..8c2f145cb6a 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 82fe29acb2a..c358382a01a 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);