mirror of https://github.com/apache/cloudstack.git
framework/db: add checkConnection method
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
3c30e97d2d
commit
d89d1eec6d
|
|
@ -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<StackElement> it = _stack.iterator();
|
||||
while (it.hasNext()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue