mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +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;
|
||||
connectionsLock.lock();
|
||||
try {
|
||||
closed = true;
|
||||
for (Connection c : connections) c.close();
|
||||
for (Connection c : connections) tryToClose(c, LOG, WARNING);
|
||||
openConnections -= connections.size();
|
||||
connections.clear();
|
||||
while (openConnections > 0) {
|
||||
@@ -656,7 +656,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
LOG.warning("Interrupted while closing connections");
|
||||
interrupted = true;
|
||||
}
|
||||
for (Connection c : connections) c.close();
|
||||
for (Connection c : connections) tryToClose(c, LOG, WARNING);
|
||||
openConnections -= connections.size();
|
||||
connections.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user