From 966f068bf644028c91ffbd8ff1e0e276be835440 Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Thu, 27 Jul 2023 13:02:41 +0900 Subject: [PATCH 1/2] Bump h2 from 1.4.197 to 2.2.220 --- .../java/org/jbpm/process/workitem/camel/CamelSqlTest.java | 2 +- .../workitem/executesql/ExecuteSqlWorkItemHandlerTest.java | 4 ++-- .../org/jbpm/process/workitem/jpa/JPAWorkItemHandlerTest.java | 4 ++-- pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/camel-workitem/src/test/java/org/jbpm/process/workitem/camel/CamelSqlTest.java b/camel-workitem/src/test/java/org/jbpm/process/workitem/camel/CamelSqlTest.java index 778a6c610..2033d4e32 100644 --- a/camel-workitem/src/test/java/org/jbpm/process/workitem/camel/CamelSqlTest.java +++ b/camel-workitem/src/test/java/org/jbpm/process/workitem/camel/CamelSqlTest.java @@ -85,7 +85,7 @@ public void cleanup() { */ private static void setupDb() throws SQLException, URISyntaxException { File script = new File(CamelSqlTest.class.getResource("/init-db.sql").toURI()); - RunScript.execute("jdbc:h2:mem:jbpm-db;MVCC=true", + RunScript.execute("jdbc:h2:mem:jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE", "sa", "", script.getAbsolutePath(), diff --git a/execute-sql-workitem/src/test/java/org/jbpm/process/workitem/executesql/ExecuteSqlWorkItemHandlerTest.java b/execute-sql-workitem/src/test/java/org/jbpm/process/workitem/executesql/ExecuteSqlWorkItemHandlerTest.java index d604c7b5f..a1d6120c2 100644 --- a/execute-sql-workitem/src/test/java/org/jbpm/process/workitem/executesql/ExecuteSqlWorkItemHandlerTest.java +++ b/execute-sql-workitem/src/test/java/org/jbpm/process/workitem/executesql/ExecuteSqlWorkItemHandlerTest.java @@ -169,7 +169,7 @@ private static PoolingDataSourceWrapper setupPoolingDataSource() throws Exceptio driverProperties.setProperty("password", "sa"); driverProperties.setProperty("url", - "jdbc:h2:mem:jpa-wih;MVCC=true"); + "jdbc:h2:mem:jpa-wih;MODE=LEGACY;NON_KEYWORDS=VALUE"); driverProperties.setProperty("driverClassName", "org.h2.Driver"); @@ -185,7 +185,7 @@ private static class TestH2Server { public void start() { if (realH2Server == null || !realH2Server.isRunning(false)) { try { - realH2Server = Server.createTcpServer(new String[0]); + realH2Server = Server.createTcpServer(new String[]{"-ifNotExists"}); realH2Server.start(); System.out.println("Started H2 Server..."); } catch (SQLException e) { diff --git a/jpa-workitem/src/test/java/org/jbpm/process/workitem/jpa/JPAWorkItemHandlerTest.java b/jpa-workitem/src/test/java/org/jbpm/process/workitem/jpa/JPAWorkItemHandlerTest.java index 10057c2e0..0cfe125ad 100644 --- a/jpa-workitem/src/test/java/org/jbpm/process/workitem/jpa/JPAWorkItemHandlerTest.java +++ b/jpa-workitem/src/test/java/org/jbpm/process/workitem/jpa/JPAWorkItemHandlerTest.java @@ -356,7 +356,7 @@ public static PoolingDataSourceWrapper setupPoolingDataSource() { driverProperties.setProperty("password", "sa"); driverProperties.setProperty("url", - "jdbc:h2:mem:jpa-wih;MVCC=true"); + "jdbc:h2:mem:jpa-wih;MODE=LEGACY;NON_KEYWORDS=VALUE"); driverProperties.setProperty("driverClassName", "org.h2.Driver"); @@ -373,7 +373,7 @@ private static class TestH2Server { public void start() { if (realH2Server == null || !realH2Server.isRunning(false)) { try { - realH2Server = Server.createTcpServer(new String[0]); + realH2Server = Server.createTcpServer(new String[]{"-ifNotExists"}); realH2Server.start(); System.out.println("Started H2 Server..."); } catch (SQLException e) { diff --git a/pom.xml b/pom.xml index bd9b3b35b..2e55934ef 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,7 @@ sa sasa - jdbc:h2:tcp://localhost/${project.basedir}/target/jbpm-test;MVCC=TRUE + jdbc:h2:tcp://localhost/${project.basedir}/target/jbpm-test;MODE=LEGACY;NON_KEYWORDS=VALUE public From 06591d700fc0dae596f0cec59e50b2dce07ef445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Mu=C3=B1oz?= Date: Thu, 27 Jul 2023 13:29:58 +0200 Subject: [PATCH 2/2] [bump h2-200] Override default datasource url --- .../src/test/resources/application-test-async.properties | 3 +++ .../src/test/resources/application-test.properties | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/jbpm-workitem-itests/src/test/resources/application-test-async.properties b/jbpm-workitem-itests/src/test/resources/application-test-async.properties index b571222f0..2c4715782 100644 --- a/jbpm-workitem-itests/src/test/resources/application-test-async.properties +++ b/jbpm-workitem-itests/src/test/resources/application-test-async.properties @@ -8,6 +8,9 @@ server.port=8090 spring.jpa.properties.hibernate.hbm2ddl.auto=create spring.jpa.properties.hibernate.show_sql=false +#override datasource url to skip VALUE as a keyword for embedded h2 +spring.datasource.url=jdbc:h2:mem:jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE + # Taken from https://docs.spring.io/spring-boot/docs/2.4.0-M2/reference/htmlsingle/#common-application-properties # Used in Kafka tests where publish blocking connection timeout (max.block.ms) is 60 seconds, same as default # transaction timeout for nayarana. If this timeout is not increased, following exception is raised: diff --git a/jbpm-workitem-itests/src/test/resources/application-test.properties b/jbpm-workitem-itests/src/test/resources/application-test.properties index 2b3fa074a..605d0b8bc 100644 --- a/jbpm-workitem-itests/src/test/resources/application-test.properties +++ b/jbpm-workitem-itests/src/test/resources/application-test.properties @@ -8,6 +8,10 @@ server.port=8090 spring.jpa.properties.hibernate.hbm2ddl.auto=create spring.jpa.properties.hibernate.show_sql=false + +#override datasource url to skip VALUE as a keyword for embedded h2 +spring.datasource.url=jdbc:h2:mem:jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE + # Taken from https://docs.spring.io/spring-boot/docs/2.4.0-M2/reference/htmlsingle/#common-application-properties # Used in Kafka tests where publish blocking connection timeout (max.block.ms) is 60 seconds, same as default # transaction timeout for nayarana. If this timeout is not increased, following exception is raised: