From d1f602835eff3df33261ce16620c51fb291c0763 Mon Sep 17 00:00:00 2001 From: drecchia Date: Mon, 6 Jun 2016 09:11:00 -0300 Subject: - Fix hikari connection check sql. --- debug.xml | 4 ++++ setup/unix/traccar.xml | 4 ++++ setup/windows/traccar.xml | 4 ++++ src/org/traccar/database/DataManager.java | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debug.xml b/debug.xml index a70940108..7cd2023b9 100644 --- a/debug.xml +++ b/debug.xml @@ -54,6 +54,10 @@ ./database/changelog-master.xml + + SELECT 1; + + SELECT * FROM server; diff --git a/setup/unix/traccar.xml b/setup/unix/traccar.xml index a0233e601..bf2c5ef70 100644 --- a/setup/unix/traccar.xml +++ b/setup/unix/traccar.xml @@ -32,6 +32,10 @@ /opt/traccar/data/changelog-master.xml + + + SELECT 1; + SELECT * FROM server; diff --git a/setup/windows/traccar.xml b/setup/windows/traccar.xml index 5748f3993..d43e7373a 100644 --- a/setup/windows/traccar.xml +++ b/setup/windows/traccar.xml @@ -33,6 +33,10 @@ [CHANGELOG] + + SELECT 1; + + SELECT * FROM server; diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index ad7c4478b..4e69d1d8e 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -117,7 +117,7 @@ public class DataManager implements IdentityManager { hikariConfig.setJdbcUrl(config.getString("database.url")); hikariConfig.setUsername(config.getString("database.user")); hikariConfig.setPassword(config.getString("database.password")); - hikariConfig.setConnectionInitSql("SELECT 1 FROM DUAL"); + hikariConfig.setConnectionInitSql(config.getString("database.checkConnection")); hikariConfig.setIdleTimeout(600000); int maxPoolSize = config.getInteger("database.maxPoolSize"); -- cgit v1.2.3