More retry for TransactionTimedOutException
Related to https://github.com/spring-projects/spring-integration/issues/3307
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,6 +32,7 @@ import org.springframework.integration.support.locks.DefaultLockRegistry;
|
||||
import org.springframework.integration.support.locks.ExpirableLockRegistry;
|
||||
import org.springframework.integration.support.locks.LockRegistry;
|
||||
import org.springframework.integration.util.UUIDConverter;
|
||||
import org.springframework.transaction.TransactionTimedOutException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -46,6 +47,8 @@ import org.springframework.util.Assert;
|
||||
* @author Vedran Pavic
|
||||
* @author Kai Zimmermann
|
||||
* @author Bartosz Rempuszewski
|
||||
* @author Gary Russell
|
||||
* @author Alexandre Strubel
|
||||
*
|
||||
* @since 4.3
|
||||
*/
|
||||
@@ -164,6 +167,9 @@ public class JdbcLockRegistry implements ExpirableLockRegistry {
|
||||
catch (TransientDataAccessException e) {
|
||||
// try again
|
||||
}
|
||||
catch (TransactionTimedOutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (InterruptedException ie) {
|
||||
this.delegate.unlock();
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -208,6 +214,9 @@ public class JdbcLockRegistry implements ExpirableLockRegistry {
|
||||
catch (TransientDataAccessException e) {
|
||||
// try again
|
||||
}
|
||||
catch (TransactionTimedOutException e) {
|
||||
// try again
|
||||
}
|
||||
catch (Exception e) {
|
||||
this.delegate.unlock();
|
||||
rethrowAsLockException(e);
|
||||
|
||||
Reference in New Issue
Block a user