Add failfast and reconnexion

This commit is contained in:
Xephi59 2015-07-31 14:07:14 +02:00
parent d49b309301
commit 6b53afa731

View File

@ -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!");