Announcement Announcement Module
No announcement yet.
Restarting Job after VM halt Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Restarting Job after VM halt

    I've done a simulation of a VM halt using a debugger and stopping the VM in the middle of a job execution. When I try to restart the job I get a JobExecutionAlreadyRunningException. Is this the expected behavior? How can I recover from a VM halt?

  • #2
    The problem you are seeing is because the Status in the database was never updated to reflect that the job failed. In order to get it to restart you will have to update STATUS for the affected Job Execution in the BATCH_JOB_EXECUTION table to FAILED.


    • #3
      I managed to restart the job updating END_TIME and STATUS. Still I'd like to understand whether this is a missing feature or there is any limitation to restart the job. I mean, the job hasn't been marked as completed in the database, and there is no such job actually running. Isn't there any memory registry of the jobs running in a given moment that could be used to guarantee the job is not running and so can be restarted? It seems to me that Spring Batch is not following ACID principles accordingly.