Description
Bug description
org.springframework.batch.core.repository.support.SimpleJobRepository#deleteJobExecution(JobExecution)
does not follow the API contract outlined in org.springframework.batch.core.repository.JobRepository#deleteJobExecution(JobExecution)
.
Delete the job execution object graph (ie the job execution with its execution context, all related step executions and their executions contexts, as well as associated job parameters)
Yet SimpleJobRepository
does not such thing. It only deletes the job execution with its execution context as well as associated job parameters. That's why JobRepositoryTestUtils#removeJobExecution(JobExecution)
has to iterate over the StepExecution
s, see #4242.
Environment
Spring Batch: 5.0.0
Steps to reproduce
- create a
JobExecution
withStepExecution
s - call
JobRepository#deleteJobExecution(JobExecution)
without callingJobRepository#deleteStepExecution(StepExecution)
first
Expected behavior
SimpleJobRepository.deleteJobExecution follows the API contract and deletes step executions and step execution contexts as well.