From 1cd30b84d585d4dfb66b8956c2b7b220bd812c63 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 15 Feb 2018 23:12:42 +1100 Subject: [PATCH] check for closed connections --- .../com/intellectualcrafters/plot/database/SQLManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java b/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java index 4693dbfb4..8e5aef6d5 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java @@ -349,7 +349,7 @@ public class SQLManager implements AbstractDB { task = tasks.remove(); count++; if (task != null) { - if (task.method == null || !task.method.equals(method)) { + if (task.method == null || !task.method.equals(method) || statement == null) { if (statement != null) { lastTask.execute(statement); statement.close(); @@ -359,6 +359,9 @@ public class SQLManager implements AbstractDB { } task.set(statement); task.addBatch(statement); + if (statement.isClosed()) { + statement = null; + } } lastTask = task; } catch (Throwable e) {