summaryrefslogtreecommitdiffstats
path: root/status-control
diff options
context:
space:
mode:
authorChristophe Closset <cc697w@intl.att.com>2017-05-02 09:13:25 +0000
committerGerrit Code Review <gerrit@onap.org>2017-05-02 09:13:25 +0000
commited682f2abf0c83d036cd85cad9b91b972b8b896a (patch)
tree6a9df94fa44df117d19a17cacceda047a613a66f /status-control
parentf25267232637e4f0c1ca2bb75dfd71e6e05ab443 (diff)
parent7ee20399328e30044ebad93f2e561934b7811e51 (diff)
Merge "Fix resources leaks: CatalogDatabase"
Diffstat (limited to 'status-control')
-rw-r--r--status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java b/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
index e0e712cd48..cd8cc7f13a 100644
--- a/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
+++ b/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
@@ -62,10 +62,8 @@ public class HealthCheckUtils {
public enum NodeType {APIH, RA, BPMN};
public boolean catalogDBCheck (MsoLogger subMsoLogger, long startTime) {
- try {
- CatalogDatabase catalogDB = new CatalogDatabase ();
+ try(CatalogDatabase catalogDB = new CatalogDatabase ()) {
catalogDB.healthCheck ();
- catalogDB.close();
} catch (Exception e) {
subMsoLogger.error(MessageEnum.GENERAL_EXCEPTION, "", "HealthCheck", MsoLogger.ErrorCode.DataError, "Failed to check catalog database", e);
subMsoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Exception during healthcheck");