We are using a database (SQL Server) backed job repository with Spring Batch 2.1.3. We have been using the CommandLineJobRunner to administer our Spring Batch jobs and have run into an issue that we haven't yet found a solution for.
We have found that the optional parameters -stop and -abandon affect all jobs with the same job name. This happens regardless of the number or type of job parameters used by each job instance. For example, a 'stopped' job instance with two parameters and a 'stopped' job instance with three parameters will both be marked 'abandoned' in the job repository when you run one time the CommandLineJobRunner with the -abandon parameter. Similarly, two 'started' jobs with the same job name in the job repository will both be 'stopped' by running one time the CommandLineJobRunner with the -stop parameter.
Maybe we have missed something. Is there a way to use the CommandLineJobRunner to stop or abandon only a single job instance?
Additionally, the optional -restart parameter only restarts the last failed or stopped execution. Therefore, if we run job A and it fails and then run job A again and it fails again, there is no way (using the CommandLineJobRunner) to restart the first instance of job A prior to restarting the second instance, correct? Is this not a common enough occurrence to have included a way to restart any job instance other than the last stopped/failed execution?
Any insights you can provide are appreciated.


Reply With Quote
