Skip to content

Commit

Permalink
spring-projectsGH-3307: Retry DefaultLockRepository.acquire for Trans…
Browse files Browse the repository at this point in the history
…TimedOutEx
  • Loading branch information
Alexandre Strubel committed Jun 16, 2020
1 parent 7ec1f5c commit 066da3c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 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.
Expand Down Expand Up @@ -31,6 +31,7 @@
import org.springframework.dao.TransientDataAccessException;
import org.springframework.integration.support.locks.ExpirableLockRegistry;
import org.springframework.integration.util.UUIDConverter;
import org.springframework.transaction.TransactionTimedOutException;
import org.springframework.util.Assert;

/**
Expand All @@ -47,6 +48,7 @@
* @author Kai Zimmermann
* @author Bartosz Rempuszewski
* @author Gary Russell
* @author Alexandre Strubel
*
* @since 4.3
*/
Expand Down Expand Up @@ -131,7 +133,7 @@ public void lock() {
}
break;
}
catch (TransientDataAccessException e) {
catch (TransientDataAccessException | TransactionTimedOutException e) {
// try again
}
catch (InterruptedException e) {
Expand Down Expand Up @@ -165,7 +167,7 @@ public void lockInterruptibly() throws InterruptedException {
}
break;
}
catch (TransientDataAccessException e) {
catch (TransientDataAccessException | TransactionTimedOutException e) {
// try again
}
catch (InterruptedException ie) {
Expand Down Expand Up @@ -209,7 +211,7 @@ public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
}
return acquired;
}
catch (TransientDataAccessException e) {
catch (TransientDataAccessException | TransactionTimedOutException e) {
// try again
}
catch (Exception e) {
Expand Down

0 comments on commit 066da3c

Please sign in to comment.