diff options
Diffstat (limited to 'status-control/src')
-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"); |