|
26 | 26 | import java.util.concurrent.locks.ReentrantLock;
|
27 | 27 |
|
28 | 28 | import org.springframework.dao.CannotAcquireLockException;
|
29 |
| -import org.springframework.dao.CannotSerializeTransactionException; |
30 | 29 | import org.springframework.dao.DataAccessResourceFailureException;
|
31 |
| -import org.springframework.dao.QueryTimeoutException; |
| 30 | +import org.springframework.dao.TransientDataAccessException; |
32 | 31 | import org.springframework.integration.support.locks.DefaultLockRegistry;
|
33 | 32 | import org.springframework.integration.support.locks.ExpirableLockRegistry;
|
34 | 33 | import org.springframework.integration.support.locks.LockRegistry;
|
35 | 34 | import org.springframework.integration.util.UUIDConverter;
|
36 |
| -import org.springframework.transaction.TransactionTimedOutException; |
37 | 35 | import org.springframework.util.Assert;
|
38 | 36 |
|
39 | 37 | /**
|
|
47 | 45 | * @author Artem Bilan
|
48 | 46 | * @author Vedran Pavic
|
49 | 47 | * @author Kai Zimmermann
|
| 48 | + * @author Bartosz Rempuszewski |
50 | 49 | *
|
51 | 50 | * @since 4.3
|
52 | 51 | */
|
@@ -125,15 +124,9 @@ public void lock() {
|
125 | 124 | }
|
126 | 125 | break;
|
127 | 126 | }
|
128 |
| - catch (CannotSerializeTransactionException e) { |
| 127 | + catch (TransientDataAccessException e) { |
129 | 128 | // try again
|
130 | 129 | }
|
131 |
| - catch (TransactionTimedOutException e) { |
132 |
| - // try again |
133 |
| - } |
134 |
| - catch (QueryTimeoutException e) { |
135 |
| - // try again |
136 |
| - } |
137 | 130 | catch (InterruptedException e) {
|
138 | 131 | /*
|
139 | 132 | * This method must be uninterruptible so catch and ignore
|
@@ -165,15 +158,9 @@ public void lockInterruptibly() throws InterruptedException {
|
165 | 158 | }
|
166 | 159 | break;
|
167 | 160 | }
|
168 |
| - catch (CannotSerializeTransactionException e) { |
169 |
| - // try again |
170 |
| - } |
171 |
| - catch (TransactionTimedOutException e) { |
| 161 | + catch (TransientDataAccessException e) { |
172 | 162 | // try again
|
173 | 163 | }
|
174 |
| - catch (QueryTimeoutException e) { |
175 |
| - // try again |
176 |
| - } |
177 | 164 | catch (InterruptedException ie) {
|
178 | 165 | this.delegate.unlock();
|
179 | 166 | Thread.currentThread().interrupt();
|
@@ -215,15 +202,9 @@ public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
|
215 | 202 | }
|
216 | 203 | return acquired;
|
217 | 204 | }
|
218 |
| - catch (CannotSerializeTransactionException e) { |
219 |
| - // try again |
220 |
| - } |
221 |
| - catch (TransactionTimedOutException e) { |
| 205 | + catch (TransientDataAccessException e) { |
222 | 206 | // try again
|
223 | 207 | }
|
224 |
| - catch (QueryTimeoutException e) { |
225 |
| - // try again |
226 |
| - } |
227 | 208 | catch (Exception e) {
|
228 | 209 | this.delegate.unlock();
|
229 | 210 | rethrowAsLockException(e);
|
|
0 commit comments