mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Fix a race condition when starting a transaction during shutdown.
This commit is contained in:
@@ -582,7 +582,13 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
txn.setAutoCommit(false);
|
||||
connectionsLock.lock();
|
||||
try {
|
||||
// The DB may have been closed since the check above
|
||||
if (closed) {
|
||||
tryToClose(txn, LOG, WARNING);
|
||||
throw new DbClosedException();
|
||||
}
|
||||
openConnections++;
|
||||
connectionsChanged.signalAll();
|
||||
} finally {
|
||||
connectionsLock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user