JobRepository.deleteJobInstance() Fails with Foreign Key Constraint Violation if Job Executions have Step Executions #4382
Labels
for: backport-to-5.0.x
Issues that will be back-ported to the 5.0.x line
for: backport-to-5.1.x
Issues that will be back-ported to the 5.1.x line
has: minimal-example
Bug reports that provide a minimal complete reproducible example
in: core
status: feedback-provided
Issues for which the feedback requested from the reporter was provided
type: bug
Milestone
Related to #4242
Bug description
Using the method
deleteJobInstance
from JobRepository does not work if a JobExecution still has StepExecutionsExplications from my understanding
The work done in this commit works well: when you call
JobRepository.findJobExecutions()
it returns the JobExecutions with all the StepExecutionsHowever when you call
JobRepository.deleteJobInstance()
the method called for retrieving the JobExecutions is notJobRepository.findJobExecutions()
butthis.jobExecutionDao.findJobExecutions(jobInstance)
thus resulting in the abscence of the StepExecutions in the JobExecutionsEnvironment
Spring Batch 5.0.1
Steps to reproduce
deleteJobInstance
Expected behavior
All objects are correctly deleted from the database using
deleteJobInstance
Thanks in advance for the consideration
The text was updated successfully, but these errors were encountered: