BUG fix for DB connection
[dmaap/datarouter.git] / 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