Skip to content

Commit

Permalink
More retry for TransactionTimedOutException
Browse files Browse the repository at this point in the history
Related to #3307
  • Loading branch information
artembilan committed Jun 16, 2020
1 parent b4d9831 commit a24f24f
Showing 1 changed file with 10 additions and 1 deletion.
@@ -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.
Expand Down Expand Up @@ -32,6 +32,7 @@
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;

/**
Expand All @@ -46,6 +47,8 @@
* @author Vedran Pavic
* @author Kai Zimmermann
* @author Bartosz Rempuszewski
* @author Gary Russell
* @author Alexandre Strubel
*
* @since 4.3
*/
Expand Down Expand Up @@ -164,6 +167,9 @@ public void lockInterruptibly() throws InterruptedException {
catch (TransientDataAccessException e) {
// try again
}
catch (TransactionTimedOutException e) {
// try again
}
catch (InterruptedException ie) {
this.delegate.unlock();
Thread.currentThread().interrupt();
Expand Down Expand Up @@ -208,6 +214,9 @@ public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
catch (TransientDataAccessException e) {
// try again
}
catch (TransactionTimedOutException e) {
// try again
}
catch (Exception e) {
this.delegate.unlock();
rethrowAsLockException(e);
Expand Down

0 comments on commit a24f24f

Please sign in to comment.