Commit 9b9099d
Fix #5340: Allow restart of jobs with JobParameterIncrementer from command line
This commit addresses the issue where jobs using JobParameterIncrementer
could not be restarted from the command line. Previously, the start()
method would always use the incrementer to create a new instance, even
when there was a failed/stopped job instance that could be restarted.
Changes:
- Modified SimpleJobOperator.start() to first try running the job with
provided parameters (which restarts failed/stopped instances)
- Only use the incrementer when JobInstanceAlreadyCompleteException
is thrown (meaning the job instance is already complete)
This allows jobs with JobParameterIncrementer to be restarted from the
command line when they fail or stop, while still creating new instances
when the previous instance is complete.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent d8632a3 commit 9b9099d
1 file changed
Lines changed: 18 additions & 7 deletions
File tree
- spring-batch-core/src/main/java/org/springframework/batch/core/launch/support
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
198 | 210 | | |
199 | | - | |
200 | 211 | | |
201 | 212 | | |
202 | 213 | | |
| |||
0 commit comments