diff options
author | Christophe Closset <cc697w@intl.att.com> | 2017-05-02 09:13:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-05-02 09:13:25 +0000 |
commit | ed682f2abf0c83d036cd85cad9b91b972b8b896a (patch) | |
tree | 6a9df94fa44df117d19a17cacceda047a613a66f /status-control | |
parent | f25267232637e4f0c1ca2bb75dfd71e6e05ab443 (diff) | |
parent | 7ee20399328e30044ebad93f2e561934b7811e51 (diff) |
Merge "Fix resources leaks: CatalogDatabase"
Diffstat (limited to 'status-control')
-rw-r--r-- | status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java | 4 |
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"); |