Skip to content

Commit

Permalink
updated Para to v1.30.0, fixed H2 TCP configuration issue for server …
Browse files Browse the repository at this point in the history
…mode
  • Loading branch information
albogdano committed Aug 7, 2018
1 parent 8a85c45 commit 203254c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Expand Up @@ -69,7 +69,7 @@
<dependency>
<groupId>com.erudika</groupId>
<artifactId>para-core</artifactId>
<version>1.29.2</version>
<version>1.30.0</version>
<scope>provided</scope>
</dependency>

Expand All @@ -84,7 +84,6 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<!-- 1.4.197 breaks tests! -->
<version>1.4.197</version>
</dependency>

Expand Down Expand Up @@ -252,7 +251,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/erudika/para/persistence/H2Utils.java
Expand Up @@ -61,15 +61,15 @@ private H2Utils() { }
*/
static Connection getConnection() throws SQLException {
String host = Config.getConfigParam("db.hostname", "");
String serverPrefix = StringUtils.isBlank(host) ? "" : "tcp://" + host + "/";
String dir = Config.getConfigParam("db.dir", serverPrefix.isEmpty() ? "./data" : "data");
String url = "jdbc:h2:" + serverPrefix + dir + File.separator + Config.getRootAppIdentifier();
String tcpPrefix = StringUtils.isBlank(host) ? "" : "tcp://" + host + "/";
String dir = Config.getConfigParam("db.dir", "./data");
String url = "jdbc:h2:" + tcpPrefix + dir + File.separator + Config.getRootAppIdentifier();
String user = Config.getConfigParam("db.user", Config.getRootAppIdentifier());
String pass = Config.getConfigParam("db.password", "secret");
try {
if (server == null) {
org.h2.Driver.load();
String serverParams = Config.getConfigParam("db.tcpServer", "-baseDir " + dir);
String serverParams = Config.getConfigParam("db.tcpServer", tcpPrefix.isEmpty() ? "-baseDir " + dir : "");
String[] params = StringUtils.split(serverParams, ' ');
server = Server.createTcpServer(params);
server.start();
Expand Down

0 comments on commit 203254c

Please sign in to comment.