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
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,7 @@ public class CommunicationsManager { ...@@ -77,6 +77,7 @@ public class CommunicationsManager {
*/ */
private void initAccountTypes() throws TskCoreException { private void initAccountTypes() throws TskCoreException {
CaseDbConnection connection = db.getConnection(); CaseDbConnection connection = db.getConnection();
db.acquireSingleUserCaseWriteLock();
Statement statement = null; Statement statement = null;
ResultSet resultSet = null; ResultSet resultSet = null;
...@@ -115,6 +116,7 @@ private void initAccountTypes() throws TskCoreException { ...@@ -115,6 +116,7 @@ private void initAccountTypes() throws TskCoreException {
closeResultSet(resultSet); closeResultSet(resultSet);
closeStatement(statement); closeStatement(statement);
connection.close(); connection.close();
db.releaseSingleUserCaseWriteLock();
} }
} }
...@@ -130,6 +132,7 @@ private void initAccountTypes() throws TskCoreException { ...@@ -130,6 +132,7 @@ private void initAccountTypes() throws TskCoreException {
*/ */
private int readAccountTypes() throws SQLException, TskCoreException { private int readAccountTypes() throws SQLException, TskCoreException {
CaseDbConnection connection = db.getConnection(); CaseDbConnection connection = db.getConnection();
db.acquireSingleUserCaseReadLock();
Statement statement = null; Statement statement = null;
ResultSet resultSet = null; ResultSet resultSet = null;
int count = 0; int count = 0;
...@@ -158,6 +161,7 @@ private int readAccountTypes() throws SQLException, TskCoreException { ...@@ -158,6 +161,7 @@ private int readAccountTypes() throws SQLException, TskCoreException {
closeResultSet(resultSet); closeResultSet(resultSet);
closeStatement(statement); closeStatement(statement);
connection.close(); connection.close();
db.releaseSingleUserCaseReadLock();
} }
return count; return count;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment