Fixes #591 Synchronise the track statement method, and clearing of the tracked statement list.

pull/611/head
Brett Wooldridge 9 years ago
parent 21357a6b08
commit 5eebe56dd1

@ -182,7 +182,7 @@ public abstract class ProxyConnection implements Connection
leakTask.cancel();
}
private final <T extends Statement> T trackStatement(final T statement)
private final synchronized <T extends Statement> T trackStatement(final T statement)
{
openStatements.add(statement);
@ -205,9 +205,11 @@ public abstract class ProxyConnection implements Connection
}
}
synchronized (this) {
openStatements.clear();
}
}
}
// **********************************************************************
// "Overridden" java.sql.Connection Methods

@ -184,6 +184,10 @@ public final class FastList<T> extends ArrayList<T>
@Override
public T remove(int index)
{
if (size == 0) {
return null;
}
final T old = elementData[index];
final int numMoved = size - index - 1;

Loading…
Cancel
Save