You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
Running a Job and then using JobRepositoryTestUtils#removeJobExecutions() fails, because the method does not delete the StepExecutions.
The method selects the executions to delete with this code:
if (jobExecutions != null && !jobExecutions.isEmpty()) {
removeJobExecutions(jobExecutions);
}
But findJobExecutions(JobInstance) does not populate the execution's stepExecutions attribute (we are missing a call to stepExecutionDao#addStepExecutions(JobExecution)):
Related to #4229.
Bug description
Running a Job and then using
JobRepositoryTestUtils#removeJobExecutions()
fails, because the method does not delete theStepExecution
s.The method selects the executions to delete with this code:
spring-batch/spring-batch-test/src/main/java/org/springframework/batch/test/JobRepositoryTestUtils.java
Lines 168 to 171 in 9223826
But
findJobExecutions(JobInstance)
does not populate the execution'sstepExecutions
attribute (we are missing a call tostepExecutionDao#addStepExecutions(JobExecution)
):spring-batch/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java
Lines 100 to 103 in 9223826
The subsequent call to
removeJobExecutions(jobExecutions)
then won't delete theStepExecution
s, due togetStepExecutions()
being empty:spring-batch/spring-batch-test/src/main/java/org/springframework/batch/test/JobRepositoryTestUtils.java
Lines 148 to 151 in 9223826
This causes FK constraint violations when the job executions themselves are then deleted afterwards.
Environment
Spring Batch 5.0.0-SNAPSHOT (this commit)
Steps to reproduce
JobRepositoryTestUtils#removeJobExecutions()
Expected behavior
Method call succeeds, all executions are deleted.
The text was updated successfully, but these errors were encountered: