Description
Related to #4242
Bug description
Using the method deleteJobInstance
from JobRepository does not work if a JobExecution still has StepExecutions
Explications from my understanding
The work done in this commit works well: when you call JobRepository.findJobExecutions()
it returns the JobExecutions with all the StepExecutions
However when you call JobRepository.deleteJobInstance()
the method called for retrieving the JobExecutions is not JobRepository.findJobExecutions()
but this.jobExecutionDao.findJobExecutions(jobInstance)
thus resulting in the abscence of the StepExecutions in the JobExecutions
Environment
Spring Batch 5.0.1
Steps to reproduce
- Create a new Job.
- Try to delete all Executions/Instances of this Job using
deleteJobInstance
- Foreign Key Constraint Violation error occurs
Expected behavior
All objects are correctly deleted from the database using deleteJobInstance
Thanks in advance for the consideration