mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Continue with closing connections if an exception is thrown.
This commit is contained in:
@@ -641,12 +641,12 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void closeAllConnections() throws SQLException {
|
void closeAllConnections() {
|
||||||
boolean interrupted = false;
|
boolean interrupted = false;
|
||||||
connectionsLock.lock();
|
connectionsLock.lock();
|
||||||
try {
|
try {
|
||||||
closed = true;
|
closed = true;
|
||||||
for (Connection c : connections) c.close();
|
for (Connection c : connections) tryToClose(c, LOG, WARNING);
|
||||||
openConnections -= connections.size();
|
openConnections -= connections.size();
|
||||||
connections.clear();
|
connections.clear();
|
||||||
while (openConnections > 0) {
|
while (openConnections > 0) {
|
||||||
@@ -656,7 +656,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
LOG.warning("Interrupted while closing connections");
|
LOG.warning("Interrupted while closing connections");
|
||||||
interrupted = true;
|
interrupted = true;
|
||||||
}
|
}
|
||||||
for (Connection c : connections) c.close();
|
for (Connection c : connections) tryToClose(c, LOG, WARNING);
|
||||||
openConnections -= connections.size();
|
openConnections -= connections.size();
|
||||||
connections.clear();
|
connections.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user