summaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/main
diff options
context:
space:
mode:
authorRam Koya <rk541m@att.com>2018-08-31 15:25:38 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-31 15:25:38 +0000
commit4fe3669fbd63c06ab4d87ed371a49ab2ac9b066a (patch)
tree1d3366484e3043e40209872af5f264becf2d35aa /datarouter-prov/src/main
parentd88f9be17654939fe085e6dc417220b3d7486556 (diff)
parent26fb914c67acb060987671e0ce12d584d9786e54 (diff)
Merge "Sonar fix for DB.java"
Diffstat (limited to 'datarouter-prov/src/main')
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java
index bbcacb53..7f0d56b7 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java
@@ -112,13 +112,16 @@ public class DB {
throw sqlEx;
}
}
+ finally {
+ if (connection != null && !connection.isValid(1)) {
+ connection.close();
+ connection = null;
+ }
+ }
} while (connection == null);
}
}
- if (connection != null && !connection.isValid(1)) {
- connection.close();
- connection = null;
- }
+
}
return connection;
}