Announcement Announcement Module
Collapse
No announcement yet.
Stop/Abandon/Restart Using CommandLineJobRunner Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stop/Abandon/Restart Using CommandLineJobRunner

    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.

  • #2
    The stop/abandon/restart operations all accept a JobExecution id as a qualifier (otherwise they act on all possible executions with the name provided). the javadocs for CommandLineJobRunner attempt to explain this:

    jobIdentifier: the name of the job or the id of a job execution (for -stop, -abandon or -restart).
    but maybe we can make it clearer?

    Comment


    • #3
      Originally posted by Dave Syer View Post
      but maybe we can make it clearer?
      Aha. Since the Javadoc didn't include a description of the differences between using the job name and the job id, it seemed to me that the end result would be the same (i.e. it listed them as if they were interchangeable).

      Thanks for the help.

      Comment

      Working...
      X