From 63e26495fca281bd9bd25780eeeb895e927367f3 Mon Sep 17 00:00:00 2001 From: Paul Dennehy Date: Thu, 27 Sep 2018 15:54:08 +0100 Subject: [PATCH] BUG fix for DB connection Change-Id: I603c0405f5f086e190ac5132c6956065676aca1e Signed-off-by: Paul Dennehy Issue-ID: DMAAP-831 --- .../java/org/onap/dmaap/datarouter/provisioning/utils/DB.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 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 1952f946..3e2436fa 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 @@ -123,16 +123,14 @@ public class DB { if (++n >= 3) { 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; } -- 2.16.6