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:
Kai Zimmermann
2017-07-11 16:25:45 +02:00
committed by Artem Bilan
parent aff326875b
commit f50a2947ac

View File

@@ -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);