Announcement Announcement Module
Collapse
No announcement yet.
Batch Recovery And Repository Update Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment

        Working...
        X