INT-4311: JdbcLocks: QueryTimeoutException retry
JIRA: https://jira.spring.io/browse/INT-4311 * Added `QueryTimeoutException` to retry handling in the `JdbcLockRegistry` Polishing **Cherry-pick to 4.3.x**
This commit is contained in:
committed by
Artem Bilan
parent
aff326875b
commit
f50a2947ac
@@ -28,6 +28,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
import org.springframework.dao.CannotAcquireLockException;
|
||||
import org.springframework.dao.CannotSerializeTransactionException;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.dao.QueryTimeoutException;
|
||||
import org.springframework.integration.support.locks.DefaultLockRegistry;
|
||||
import org.springframework.integration.support.locks.ExpirableLockRegistry;
|
||||
import org.springframework.integration.support.locks.LockRegistry;
|
||||
@@ -45,6 +46,7 @@ import org.springframework.util.Assert;
|
||||
* @author Dave Syer
|
||||
* @author Artem Bilan
|
||||
* @author Vedran Pavic
|
||||
* @author Kai Zimmermann
|
||||
*
|
||||
* @since 4.3
|
||||
*/
|
||||
@@ -129,6 +131,9 @@ public class JdbcLockRegistry implements ExpirableLockRegistry {
|
||||
catch (TransactionTimedOutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (QueryTimeoutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
/*
|
||||
* This method must be uninterruptible so catch and ignore
|
||||
@@ -166,6 +171,9 @@ public class JdbcLockRegistry implements ExpirableLockRegistry {
|
||||
catch (TransactionTimedOutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (QueryTimeoutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (InterruptedException ie) {
|
||||
this.delegate.unlock();
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -213,6 +221,9 @@ public class JdbcLockRegistry implements ExpirableLockRegistry {
|
||||
catch (TransactionTimedOutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (QueryTimeoutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (Exception e) {
|
||||
this.delegate.unlock();
|
||||
rethrowAsLockException(e);
|
||||
|
||||
Reference in New Issue
Block a user