Skip to content

Commit b4d9831

Browse files
committed
GH-3307: Retry TransTimedEx in LockRepo.acquire
Fixes #3307 The `DefaultLockRepository.acquire()` is transactional method and can fail with the `TransactionTimedOutException`. When we call `JdbcLock.lock()`, we expect an attempt until we really obtain a lock. * Treat a `TransactionTimedOutException` as a `TransientDataAccessException` and therefore retry a locking attempt logic **Cherry-pick to 5.3.x, 5.2.x & 4.3.x** (cherry picked from commit b0cd015) # Conflicts: # spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/JdbcLockRegistry.java
1 parent 415fb64 commit b4d9831

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/JdbcLockRegistry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public void lock() {
127127
catch (TransientDataAccessException e) {
128128
// try again
129129
}
130+
catch (TransactionTimedOutException e) {
131+
// try again
132+
}
130133
catch (InterruptedException e) {
131134
/*
132135
* This method must be uninterruptible so catch and ignore

0 commit comments

Comments
 (0)