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

Merge pull request #2303 from APriestman/7383_changeLockOrder

7383 Get lock before connection to prevent warning.
parents 5e078948 3a02a97a
No related branches found
No related tags found
No related merge requests found
...@@ -5516,11 +5516,12 @@ ObjectInfo getParentInfo(Content c) throws TskCoreException { ...@@ -5516,11 +5516,12 @@ ObjectInfo getParentInfo(Content c) throws TskCoreException {
* within tsk core * within tsk core
*/ */
ObjectInfo getParentInfo(long contentId) throws TskCoreException { ObjectInfo getParentInfo(long contentId) throws TskCoreException {
CaseDbConnection connection = connections.getConnection();
acquireSingleUserCaseReadLock(); acquireSingleUserCaseReadLock();
CaseDbConnection connection = null;
Statement s = null; Statement s = null;
ResultSet rs = null; ResultSet rs = null;
try { try {
connection = connections.getConnection();
s = connection.createStatement(); s = connection.createStatement();
rs = connection.executeQuery(s, "SELECT parent.obj_id AS obj_id, parent.type AS type " //NON-NLS rs = connection.executeQuery(s, "SELECT parent.obj_id AS obj_id, parent.type AS type " //NON-NLS
+ "FROM tsk_objects AS parent INNER JOIN tsk_objects AS child " //NON-NLS + "FROM tsk_objects AS parent INNER JOIN tsk_objects AS child " //NON-NLS
...@@ -5536,7 +5537,9 @@ ObjectInfo getParentInfo(long contentId) throws TskCoreException { ...@@ -5536,7 +5537,9 @@ ObjectInfo getParentInfo(long contentId) throws TskCoreException {
} finally { } finally {
closeResultSet(rs); closeResultSet(rs);
closeStatement(s); closeStatement(s);
connection.close(); if (connection != null) {
connection.close();
}
releaseSingleUserCaseReadLock(); releaseSingleUserCaseReadLock();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment