BUG fix for DB connection 53/69353/1
authorPaul Dennehy <paul.p.dennehy@ericsson.com>
Thu, 27 Sep 2018 14:54:08 +0000 (15:54 +0100)
committerPaul Dennehy <paul.p.dennehy@ericsson.com>
Thu, 27 Sep 2018 14:54:16 +0000 (15:54 +0100)
Change-Id: I603c0405f5f086e190ac5132c6956065676aca1e
Signed-off-by: Paul Dennehy <paul.p.dennehy@ericsson.com>
Issue-ID: DMAAP-831

datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DB.java

index 1952f94..3e2436f 100644 (file)
@@ -123,16 +123,14 @@ public class DB {
                             if (++n >= 3) {\r
                                 throw sqlEx;\r
                             }\r
-                        } finally {\r
-                            if (connection != null && !connection.isValid(1)) {\r
-                                connection.close();\r
-                                connection = null;\r
-                            }\r
                         }\r
                     } while (connection == null);\r
                 }\r
             }\r
-\r
+            if (connection != null && !connection.isValid(1)) {\r
+                connection.close();\r
+                connection = null;\r
+            }\r
         }\r
         return connection;\r
     }\r