Oct 5th, 2012, 10:36 AM
how to restart the Executing jobs
I have a situation.
When the Spring batch is running and if due to any reason the process crashes, the currently executing job is exiting in the STATE as EXECUTING and not able to restart that job again.
Can any one please tell me how can i get through this.
I have only one parameter in the job and this cannot be changed, the job with same job parameter has to be executed?
Oct 5th, 2012, 02:38 PM
- I'd be interested in seeing the stack trace that is causing the error. The framework should handle thrown exceptions (assuming it can) and mark the execution accordingly.
- To restart your job, you'll have to manually mark it as FAILED.
Oct 7th, 2012, 02:56 AM
Im afraid i can provide any stack trace?.... I suspect there could be any stack trace or error if process is crashed due the server going down...
Basically the server im running has many other different processes which may cause the whole system crash due high CPU/IO usage by all the processes at the same.
With respect to Point 2:
How to manually set the Job to be failed.. jus setting the job in the Spring batch DB is sufficient or any thing else is required to be performed??
Can u please provide in detail on how to set the job as FAILED?
Ravi Shanker .P
Oct 10th, 2012, 09:14 AM
Updating the database is all you need to do. Be sure to update both the job and any step that my have been in the RUNNING state to FAILED.
Oct 13th, 2012, 12:08 AM
As indicated, i tried changing the STATUS and EXIT_CODE of the Executing/Started jobs to FAILED state while the process has crashed.. but still Im getting JobInstance already exists error while restarting the Job.
Can u please let me know other than the STATUS what else is required for me to update.
Oct 22nd, 2012, 04:49 PM
How are you launching the job?
Oct 23rd, 2012, 11:37 AM
You also need to set the END_TIME of the job execution.