check for closed connections

This commit is contained in:
Jesse Boyd 2018-02-15 23:12:42 +11:00
parent eb1c3263ec
commit 1cd30b84d5
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -349,7 +349,7 @@ public class SQLManager implements AbstractDB {
task = tasks.remove(); task = tasks.remove();
count++; count++;
if (task != null) { if (task != null) {
if (task.method == null || !task.method.equals(method)) { if (task.method == null || !task.method.equals(method) || statement == null) {
if (statement != null) { if (statement != null) {
lastTask.execute(statement); lastTask.execute(statement);
statement.close(); statement.close();
@ -359,6 +359,9 @@ public class SQLManager implements AbstractDB {
} }
task.set(statement); task.set(statement);
task.addBatch(statement); task.addBatch(statement);
if (statement.isClosed()) {
statement = null;
}
} }
lastTask = task; lastTask = task;
} catch (Throwable e) { } catch (Throwable e) {