Results 1 to 2 of 2

Thread: Bit Confused on Stopping Jobs

  1. #1

    Default Bit Confused on Stopping Jobs

    Sorry there, i've read the documentation, evne a few times course that doesnt mean i still don't have it correct.


    BUT my question is on stopping and restarting a job.

    So if i have a job, i want to start and restop. I first assume i have to set restartable to true.

    Now let's say i have 3 steps. In the middle of step two i grab the JobExecution and tell it to stop the job.

    Now i want to restart the job.

    Is the job going to restart from step 1. Or is it going to restart where it left off? And if it restarts where it left off how does it know where to restart? I am assuming somehow through the mark and reset?

    if there isnt a way to identify would it be that hard to make it so that there is a way?

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    I think there's two parts to your question:

    The first is about what happens to steps that have already been completed in a restart scenario. If you have three steps, and the first two complete, and the third fails midway through, the first two will be skipped, and the third will be started.

    The next part of your question I think deals with what happens with that third step. Every StepExecution is given an ExecutionContext(EC), in which to store any properties regarding it's current state. When a step is restarted, the EC is reconstituted from the database and given to the step. Most of the readers and writers that come with the framework will check the EC when the Step calls open, to see if any values they care about are stored there. In the case of FlatFileItemReader, it will be checking for the last line number it was processing. If it finds it, it will move to the line and start reading from there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •