3 Replies Latest reply on May 27, 2015 12:36 PM by Lars-Erik Helander

    Restart job execution

    Lars-Erik Helander Newbie

      I have a setup using wildly 8.2.0.Final and defined batch information to be persisted in a h2 database.

       

      I run an application that starts a job instance in case no jobs exists. Before the job completes , but after a few steps have been completed, the server is shutdown.

       

      (an observation here is that the batch status for the job is not updated to STARTED in the database, it says STARTING, even if the API returns STARTED)

       

      When I restart the server, my application detects that there already exists a job instance, and it tries to execute a restart(). It fails with the current exception

       

      09:30:36,069 ERROR [stderr] (MSC service thread 1-5) javax.batch.operations.JobRestartException: JBERET000610: Failed to restart job execution 1, which had batch status STARTING.

       

      I am mostly interested in being able to restart jobs that were not completed once my server/application is restarted, and right now I do not know how to achieve that.

       

      Anyone that could shed some light on this?