DBZ-769 Try to release table locks during exception
This commit is contained in:
parent
6f0d11cc64
commit
6fe48b7764
@ -699,6 +699,21 @@ protected void execute() {
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
if (isLocked) {
|
||||
try {
|
||||
sql.set("UNLOCK TABLES");
|
||||
mysql.execute(sql.get());
|
||||
}
|
||||
catch (Exception eUnlock) {
|
||||
logger.error("Removing of table locks not completed successfully", eUnlock);
|
||||
}
|
||||
try {
|
||||
mysql.connection().rollback();
|
||||
}
|
||||
catch (Exception eRollback) {
|
||||
logger.error("Execption while rollback is executed", eRollback);
|
||||
}
|
||||
}
|
||||
failed(e, "Aborting snapshot due to error when last running '" + sql.get() + "': " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user