From b3f6d9136e435ee2ea3cb93a64ffbfbaea876f75 Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Fri, 24 Mar 2017 12:42:41 +0530 Subject: [PATCH] CW1261: Do not reset connection for user managed connections --- .../db/src/com/cloud/utils/db/TransactionLegacy.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java index 64343c649bf..e594878df7e 100755 --- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java +++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java @@ -182,12 +182,14 @@ public class TransactionLegacy implements Closeable { } public void checkConnection() { - try { - if (_conn != null && !_conn.isValid(3)) { + if ( _dbId != CONNECTED_DB) { + try { + if (_conn != null && !_conn.isValid(3)) { + _conn = null; + } + } catch (SQLException e) { _conn = null; } - } catch (SQLException e) { - _conn = null; } }