Fix object graph deletion in SimpleJobRepository#deleteJobExecution
Before this commit, SimpleJobRepository#deleteJobExecution did not delete associated step executions as specified in the contract of the method. This commit fixes the implementation to delete the entire object graph as specified. Resolves #4249
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -320,6 +320,9 @@ public class SimpleJobRepository implements JobRepository {
|
||||
public void deleteJobExecution(JobExecution jobExecution) {
|
||||
this.ecDao.deleteExecutionContext(jobExecution);
|
||||
this.jobExecutionDao.deleteJobExecutionParameters(jobExecution);
|
||||
for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
|
||||
deleteStepExecution(stepExecution);
|
||||
}
|
||||
this.jobExecutionDao.deleteJobExecution(jobExecution);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user