Skip to content

Commit

Permalink
Bump h2 from 1.4.197 to 2.2.220 (#5395) (#5427)
Browse files Browse the repository at this point in the history
* Bump h2 from 1.4.197 to 2.2.220

- Additional fix

* - add ifNotExists

Co-authored-by: Toshiya Kobayashi <toshiyakobayashi@gmail.com>
  • Loading branch information
github-actions[bot] and tkobayas committed Aug 2, 2023
1 parent 6ad8380 commit fc5f8d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion drools-persistence/drools-persistence-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
<maven.jdbc.driver.jar/>
<maven.jdbc.username/>
<maven.jdbc.password/>
<maven.jdbc.url>jdbc:h2:mem:test</maven.jdbc.url>
<!-- appending ;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE to the jdbc url is necessary to workaround the problem reported at -->
<!-- https://github.com/h2database/h2database/issues/3325 -->
<maven.jdbc.url>jdbc:h2:mem:test;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE</maven.jdbc.url>
<maven.jdbc.schema>public</maven.jdbc.schema>
</properties>

Expand Down
4 changes: 3 additions & 1 deletion drools-traits/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
<maven.jdbc.driver.jar/>
<maven.jdbc.username/>
<maven.jdbc.password/>
<maven.jdbc.url>jdbc:h2:mem:test</maven.jdbc.url>
<!-- appending ;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE to the jdbc url is necessary to workaround the problem reported at -->
<!-- https://github.com/h2database/h2database/issues/3325 -->
<maven.jdbc.url>jdbc:h2:mem:test;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE</maven.jdbc.url>
<maven.jdbc.schema>public</maven.jdbc.schema>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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!");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fc5f8d6

Please sign in to comment.