diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java index 7784d2f4399..fc2502c849d 100755 --- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java +++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java @@ -177,6 +177,16 @@ public class TransactionLegacy implements Closeable { return txn; } + public void checkConnection() { + try { + if (_conn != null && !_conn.isValid(3)) { + _conn = null; + } + } catch (SQLException e) { + _conn = null; + } + } + protected StackElement peekInStack(Object obj) { final Iterator it = _stack.iterator(); while (it.hasNext()) {