diff options
author | Dan Timoney <dtimoney@att.com> | 2017-09-20 19:32:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-20 19:32:15 +0000 |
commit | e474fdc8473b2ddc9f445d9e44114b8f8225c956 (patch) | |
tree | 696c788d0d0938633033c6f1c3c20ab5872289a5 | |
parent | da4bfcac8a56eb123565ea1f979217e75b6a6e1c (diff) | |
parent | 5e31510dba7647b0d0873d9864a0ee6c309e2247 (diff) |
Merge "Fix Sonar Issue"
-rwxr-xr-x | dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java index a5902d54b..4d920e6a0 100755 --- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java +++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java @@ -603,22 +603,14 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito protected boolean unlockTable(Connection conn) { boolean retValue = false; - Statement lock = null; - try { + try (Statement lock = conn.createStatement()){ if(LOGGER.isDebugEnabled()) { LOGGER.debug("Executing 'UNLOCK TABLES' on connection " + conn.toString()); } - lock = conn.createStatement(); retValue = lock.execute("UNLOCK TABLES"); } catch(Exception exc){ LOGGER.error("", exc); retValue = false; - } finally { - try { - lock.close(); - } catch(Exception exc) { - - } } return retValue; } |