From b1277a3c9172e0be79e7c602d1ef442963d51bd3 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 31 Mar 2022 12:07:25 +0200 Subject: [PATCH] Upgrade H2 to 2.1.210 Fixes #9354 --- bom/application/pom.xml | 2 +- .../h2/deployment/H2DevServicesProcessor.java | 3 +- .../jdbc/h2/deployment/JDBCH2Processor.java | 6 +++ extensions/jdbc/jdbc-h2/runtime/pom.xml | 2 +- .../jdbc/h2/runtime/graal/CompareMode.java | 39 ------------------- .../quarkus/jdbc/h2/runtime/graal/Engine.java | 9 +---- ...nDisable.java => SessionLocalDisable.java} | 6 +-- .../jdbc/h2/runtime/graal/SessionRemote.java | 35 +++++++++++++++++ .../test/h2/H2DatabaseTestResource.java | 2 +- 9 files changed, 51 insertions(+), 53 deletions(-) delete mode 100644 extensions/jdbc/jdbc-h2/runtime/src/main/java/io/quarkus/jdbc/h2/runtime/graal/CompareMode.java rename extensions/jdbc/jdbc-h2/runtime/src/main/java/io/quarkus/jdbc/h2/runtime/graal/{SessionDisable.java => SessionLocalDisable.java} (70%) create mode 100644 extensions/jdbc/jdbc-h2/runtime/src/main/java/io/quarkus/jdbc/h2/runtime/graal/SessionRemote.java diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 24a1858222f90..cf1c48df98c96 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -113,7 +113,7 @@ 4.1.5 9.1.6 2.3.2 - 1.4.197 + 2.1.210 42.3.3 3.0.4 8.0.28 diff --git a/extensions/devservices/h2/src/main/java/io/quarkus/devservices/h2/deployment/H2DevServicesProcessor.java b/extensions/devservices/h2/src/main/java/io/quarkus/devservices/h2/deployment/H2DevServicesProcessor.java index 1489eccd1af19..9b4fb7a7200aa 100644 --- a/extensions/devservices/h2/src/main/java/io/quarkus/devservices/h2/deployment/H2DevServicesProcessor.java +++ b/extensions/devservices/h2/src/main/java/io/quarkus/devservices/h2/deployment/H2DevServicesProcessor.java @@ -34,7 +34,8 @@ public RunningDevServicesDatasource startDatabase(Optional username, Opt OptionalInt port, LaunchMode launchMode, Optional startupTimeout) { try { final Server tcpServer = Server.createTcpServer("-tcpPort", - port.isPresent() ? String.valueOf(port.getAsInt()) : "0"); + port.isPresent() ? String.valueOf(port.getAsInt()) : "0", + "-ifNotExists"); tcpServer.start(); StringBuilder additionalArgs = new StringBuilder(); diff --git a/extensions/jdbc/jdbc-h2/deployment/src/main/java/io/quarkus/jdbc/h2/deployment/JDBCH2Processor.java b/extensions/jdbc/jdbc-h2/deployment/src/main/java/io/quarkus/jdbc/h2/deployment/JDBCH2Processor.java index 6b942aa719835..1f4d7239cf22f 100644 --- a/extensions/jdbc/jdbc-h2/deployment/src/main/java/io/quarkus/jdbc/h2/deployment/JDBCH2Processor.java +++ b/extensions/jdbc/jdbc-h2/deployment/src/main/java/io/quarkus/jdbc/h2/deployment/JDBCH2Processor.java @@ -13,6 +13,7 @@ import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.SslNativeConfigBuildItem; +import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import io.quarkus.jdbc.h2.runtime.H2AgroalConnectionConfigurer; public class JDBCH2Processor { @@ -49,4 +50,9 @@ void configureAgroalConnection(BuildProducer additional void registerDefaultDbType(BuildProducer dbKind) { dbKind.produce(new DefaultDataSourceDbKindBuildItem(DatabaseKind.H2)); } + + @BuildStep + void runtimeInitializedClasses(BuildProducer runtimeInitializedClasses) { + runtimeInitializedClasses.produce(new RuntimeInitializedClassBuildItem("org.h2.store.fs.niomem.FileNioMemData")); + } } diff --git a/extensions/jdbc/jdbc-h2/runtime/pom.xml b/extensions/jdbc/jdbc-h2/runtime/pom.xml index 2d9da9183b185..a0681c7c207e3 100644 --- a/extensions/jdbc/jdbc-h2/runtime/pom.xml +++ b/extensions/jdbc/jdbc-h2/runtime/pom.xml @@ -24,7 +24,7 @@ org.locationtech.jts jts-core - 1.15.0 + 1.17.0