From 6b53afa731f0c248d021e24e1d548481a554eb9f Mon Sep 17 00:00:00 2001 From: Xephi59 Date: Fri, 31 Jul 2015 14:07:14 +0200 Subject: [PATCH] Add failfast and reconnexion --- src/main/java/fr/xephi/authme/datasource/MySQL.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/fr/xephi/authme/datasource/MySQL.java b/src/main/java/fr/xephi/authme/datasource/MySQL.java index b637259ee..7ae8b6d5d 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQL.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQL.java @@ -108,6 +108,8 @@ public class MySQL implements DataSource { config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.addDataSourceProperty("autoReconnect", true); + config.addDataSourceProperty("initializationFailFast", true); ds = new HikariDataSource(config); ConsoleLogger.info("Connection pool ready"); } @@ -896,6 +898,8 @@ public class MySQL implements DataSource { config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.addDataSourceProperty("autoReconnect", true); + config.addDataSourceProperty("initializationFailFast", true); ds = new HikariDataSource(config); if (!reload) ConsoleLogger.info("ConnectionPool was unavailable... Reconnected!");