diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/JdbcLockRegistry.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/JdbcLockRegistry.java index 18a15ae19ac..4a523233696 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/JdbcLockRegistry.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/JdbcLockRegistry.java @@ -236,14 +236,20 @@ public void unlock() { this.delegate.unlock(); return; } - try { - this.mutex.delete(this.path); - } - catch (Exception e) { - throw new DataAccessResourceFailureException("Failed to release mutex at " + this.path, e); - } - finally { - this.delegate.unlock(); + while (true) { + try { + this.mutex.delete(this.path); + return; + } + catch (TransientDataAccessException e) { + // try again + } + catch (Exception e) { + throw new DataAccessResourceFailureException("Failed to release mutex at " + this.path, e); + } + finally { + this.delegate.unlock(); + } } }