From 1ba6f7bc9d8006f0764ddc2d02ebbc5a9ed96133 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Sun, 20 Sep 2015 13:36:32 -0700 Subject: [PATCH] Reliability boost for database mode. --- src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java b/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java index d31abac..10b0ef4 100644 --- a/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java @@ -613,14 +613,14 @@ public class DatabaseDataStore extends DataStore private synchronized void refreshDataConnection() throws SQLException { - if(this.databaseConnection == null || this.databaseConnection.isClosed()) + if(this.databaseConnection == null || !this.databaseConnection.isValid(3)) { //set username/pass properties Properties connectionProps = new Properties(); connectionProps.put("user", this.userName); connectionProps.put("password", this.password); connectionProps.put("autoReconnect", "true"); - connectionProps.put("maxReconnects", "4"); + connectionProps.put("maxReconnects", Integer.MAX_VALUE); //establish connection this.databaseConnection = DriverManager.getConnection(this.databaseUrl, connectionProps);