Skip to content

SimpleJobRepository.deleteJobExecution does not follow API contract #4249

Closed
@marschall

Description

@marschall

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 StepExecutions, see #4242.

Environment
Spring Batch: 5.0.0

Steps to reproduce

  • create a JobExecution with StepExecutions
  • call JobRepository#deleteJobExecution(JobExecution) without calling JobRepository#deleteStepExecution(StepExecution) first

Expected behavior

SimpleJobRepository.deleteJobExecution follows the API contract and deletes step executions and step execution contexts as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions