From 86e1b8df7c1c4dc3b6387065fb79e81da11a75fb Mon Sep 17 00:00:00 2001 From: Xephi59 Date: Thu, 20 Aug 2015 18:59:41 +0200 Subject: [PATCH] Define a max life time of a pool --- src/main/java/fr/xephi/authme/datasource/MySQL.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/fr/xephi/authme/datasource/MySQL.java b/src/main/java/fr/xephi/authme/datasource/MySQL.java index 201e6f14..45c9c651 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQL.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQL.java @@ -121,6 +121,7 @@ public class MySQL implements DataSource { config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); config.addDataSourceProperty("autoReconnect", true); + config.setMaxLifetime(12000); config.setInitializationFailFast(false); ds = new HikariDataSource(config); ConsoleLogger.info("Connection pool ready"); @@ -914,6 +915,7 @@ public class MySQL implements DataSource { config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); config.addDataSourceProperty("autoReconnect", true); config.setInitializationFailFast(false); + config.setMaxLifetime(12000); config.setPoolName("AuthMeMYSQLPool"); ds = new HikariDataSource(config); if (!reload)