|
1 | 1 | /* |
2 | | - * Copyright 2016-2019 the original author or authors. |
| 2 | + * Copyright 2016-2020 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
31 | 31 | import org.springframework.dao.TransientDataAccessException; |
32 | 32 | import org.springframework.integration.support.locks.ExpirableLockRegistry; |
33 | 33 | import org.springframework.integration.util.UUIDConverter; |
| 34 | +import org.springframework.transaction.TransactionTimedOutException; |
34 | 35 | import org.springframework.util.Assert; |
35 | 36 |
|
36 | 37 | /** |
|
47 | 48 | * @author Kai Zimmermann |
48 | 49 | * @author Bartosz Rempuszewski |
49 | 50 | * @author Gary Russell |
| 51 | + * @author Alexandre Strubel |
50 | 52 | * |
51 | 53 | * @since 4.3 |
52 | 54 | */ |
@@ -131,7 +133,7 @@ public void lock() { |
131 | 133 | } |
132 | 134 | break; |
133 | 135 | } |
134 | | - catch (TransientDataAccessException e) { |
| 136 | + catch (TransientDataAccessException | TransactionTimedOutException e) { |
135 | 137 | // try again |
136 | 138 | } |
137 | 139 | catch (InterruptedException e) { |
@@ -165,7 +167,7 @@ public void lockInterruptibly() throws InterruptedException { |
165 | 167 | } |
166 | 168 | break; |
167 | 169 | } |
168 | | - catch (TransientDataAccessException e) { |
| 170 | + catch (TransientDataAccessException | TransactionTimedOutException e) { |
169 | 171 | // try again |
170 | 172 | } |
171 | 173 | catch (InterruptedException ie) { |
@@ -209,7 +211,7 @@ public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { |
209 | 211 | } |
210 | 212 | return acquired; |
211 | 213 | } |
212 | | - catch (TransientDataAccessException e) { |
| 214 | + catch (TransientDataAccessException | TransactionTimedOutException e) { |
213 | 215 | // try again |
214 | 216 | } |
215 | 217 | catch (Exception e) { |
|
0 commit comments