diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan-connection/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/H2LocalServer.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan-connection/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/H2LocalServer.java index f3ad63d4fde..808e6500ff9 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan-connection/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/H2LocalServer.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan-connection/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/H2LocalServer.java @@ -20,18 +20,17 @@ public class H2LocalServer { - private static final H2LocalServer INSTANCE = new H2LocalServer(DynamicPortGenerator.generatePort()); + private static final H2LocalServer INSTANCE = new H2LocalServer(); private final int port; - private H2LocalServer(int port) + private H2LocalServer() { - this.port = port; try { // We can create only one instance of the server as the databases are anyway shared in the process (VM) // The important part is to have an empty name in 'this.buildDataSource("127.0.0.1", localH2Port, "", null)' // It ensure the database creation is 'private' to the connection. - AlloyH2Server.startServer(port); + this.port = AlloyH2Server.startServer(0).getPort(); } catch (SQLException e) {