Skip to content
Snippets Groups Projects
Commit dd2d758a authored by Raman's avatar Raman
Browse files

3488: missing write lock in CommunicationsManager

parent a0249850
No related branches found
No related tags found
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