Commit eac1ff5
Retry on generating unique identifiers with MongoDB
This commit will mitigate write conflict:
```
org.springframework.dao.DataIntegrityViolationException: Command failed with error 112 (WriteConflict):
'Caused by :: Write conflict during plan execution and yielding is disabled. :: Please retry your operation or multi-document transaction.' on server xxx.mongodb.net:1026.
[...]
```
Typically, only transient errors are retried, and even if `DataIntegrityViolationException` extends `NonTransientDataAccessException`,
this commit retries the operation as requested by the MongoDB driver (`Please retry your operation or multi-document transaction`).
Closes GH-4960
Signed-off-by: Yanming Zhou <[email protected]>1 parent 89122c4 commit eac1ff5
1 file changed
Lines changed: 22 additions & 3 deletions
File tree
- spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
| |||
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
47 | | - | |
48 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
49 | 58 | | |
50 | 59 | | |
51 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
52 | 71 | | |
53 | 72 | | |
54 | 73 | | |
| |||
0 commit comments