Results 1 to 3 of 3

Thread: Restarting Job after VM halt

  1. #1
    Join Date
    Jun 2005
    Posts
    7

    Default 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. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    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. #3
    Join Date
    Jun 2005
    Posts
    7

    Default

    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.

Posting Permissions

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