mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +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);
|
txn.setAutoCommit(false);
|
||||||
connectionsLock.lock();
|
connectionsLock.lock();
|
||||||
try {
|
try {
|
||||||
|
// The DB may have been closed since the check above
|
||||||
|
if (closed) {
|
||||||
|
tryToClose(txn, LOG, WARNING);
|
||||||
|
throw new DbClosedException();
|
||||||
|
}
|
||||||
openConnections++;
|
openConnections++;
|
||||||
|
connectionsChanged.signalAll();
|
||||||
} finally {
|
} finally {
|
||||||
connectionsLock.unlock();
|
connectionsLock.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user