mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge release branch 4.8 to 4.9
* 4.8: CLOUDSTACK-9460: For long running transactions, if the connection is timed out by the mysql server then refresh it
This commit is contained in:
commit
22d074607c
@ -168,7 +168,7 @@ public class TransactionLegacy implements Closeable {
|
||||
isNew = true;
|
||||
}
|
||||
}
|
||||
|
||||
txn.checkConnection();
|
||||
txn.takeOver(name, false);
|
||||
if (isNew) {
|
||||
s_mbean.addTransaction(txn);
|
||||
@ -176,6 +176,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…
x
Reference in New Issue
Block a user