mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-07 11:20:11 +01:00
Handled unhandled deadlock case for MySQL
Affects issues: - Fixed #1383
This commit is contained in:
parent
4fc565913c
commit
2f282dc7cc
@ -87,7 +87,7 @@ public abstract class Transaction {
|
|||||||
int errorCode = statementFail.getErrorCode();
|
int errorCode = statementFail.getErrorCode();
|
||||||
boolean mySQLDeadlock = dbType == DBType.MYSQL && errorCode == 1213;
|
boolean mySQLDeadlock = dbType == DBType.MYSQL && errorCode == 1213;
|
||||||
boolean h2Deadlock = dbType == DBType.H2 && errorCode == 40001;
|
boolean h2Deadlock = dbType == DBType.H2 && errorCode == 40001;
|
||||||
boolean deadlocked = mySQLDeadlock || h2Deadlock;
|
boolean deadlocked = mySQLDeadlock || h2Deadlock || statementFail instanceof SQLTransactionRollbackException;
|
||||||
if (deadlocked && attempts < ATTEMPT_LIMIT) {
|
if (deadlocked && attempts < ATTEMPT_LIMIT) {
|
||||||
executeTransaction(db); // Recurse to attempt again.
|
executeTransaction(db); // Recurse to attempt again.
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user