Skip to content
Snippets Groups Projects
Unverified Commit 37e2d9cc authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1103 from raman-bt/release-4.6.0

3488: missing write lock in CommunicationsManager
parents a0249850 dd2d758a
Branches
Tags
No related merge requests found
......@@ -77,6 +77,7 @@ public class CommunicationsManager {
*/
private void initAccountTypes() throws TskCoreException {
CaseDbConnection connection = db.getConnection();
db.acquireSingleUserCaseWriteLock();
Statement statement = null;
ResultSet resultSet = null;
......@@ -115,6 +116,7 @@ private void initAccountTypes() throws TskCoreException {
closeResultSet(resultSet);
closeStatement(statement);
connection.close();
db.releaseSingleUserCaseWriteLock();
}
}
......@@ -130,6 +132,7 @@ private void initAccountTypes() throws TskCoreException {
*/
private int readAccountTypes() throws SQLException, TskCoreException {
CaseDbConnection connection = db.getConnection();
db.acquireSingleUserCaseReadLock();
Statement statement = null;
ResultSet resultSet = null;
int count = 0;
......@@ -158,6 +161,7 @@ private int readAccountTypes() throws SQLException, TskCoreException {
closeResultSet(resultSet);
closeStatement(statement);
connection.close();
db.releaseSingleUserCaseReadLock();
}
return count;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment