mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Merge pull request #1674 from shapeblue/master_db_timout_4_8
CLOUDSTACK-9460: For long running transactions, if the connection istimed out by the mysql server then refresh it * pr/1674: CLOUDSTACK-9460: For long running transactions, if the connection is timed out by the mysql server then refresh it Signed-off-by: John Burwell <meaux@cockamamy.net>
This commit is contained in:
commit
8c3ca15995
@ -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