Results 1 to 4 of 4

Thread: Batch Recovery And Repository Update

  1. #1
    Join Date
    Apr 2011
    Posts
    3

    Default Batch Recovery And Repository Update

    Hi ,
    I'm very new to spring batch and working on a recovery scenario for a system which is using spring batch.
    Scenario:
    Few Batch jobs are running on different servers (here it's 3) . If one of 'em crashed then other server will restart the task of crashed server.
    Since batch repository (Database Repository) not allowing to start a jobs with same parameter until the other job (with same parameter) is not failed or completed mark in repository. But in this scenario (server crash) , Job status will not be update in db repository .
    Can any one suggest or guide , how to handle this scenario? Is there any timeout or any repository field which can help to identified batch job status. I want to mark that crash Job Failed or Completed and start a new Job.
    Please also correct me if my understanding about spring batch is incorrect.

    Thanks

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    Your understanding is correct. Try looking at the lastUpdated property of the StepExecution and JobExecution - that's your timeout baseline, updated once per chunk for the step and once per step for the job. You have to make a decision about how long to wait before an execution is really dead, but the APIs are all there to get you the information you require.

  3. #3
    Join Date
    Dec 2011
    Location
    India
    Posts
    14

    Default

    Hi,

    I want to implement recovery of Spring Batch to address server crash scenario, I would like to know if there is any (demonstrable) sample or document that can be referred.

    Request your help.

    Thanks & Regards

  4. #4
    Join Date
    Aug 2012
    Posts
    8

    Default

    HI,

    I am also facing a similar issue. When database crashes (or) server gets disconnected to DB server, my job status will not be updated to DB. So, later when i run the same job, i am getting JobAlreadyRunningException.
    Is there any way to stop the job, from the catch block, where i am getting this exception?

    Thanks,
    krish

Tags for this Thread

Posting Permissions

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