spring-batch
spring-batch copied to clipboard
DELETE CASCADE on Foreign Keys
Current Behaviour
The current implementation to delete job instances or job executions issues a separate SQL statement for each metadata table. (see https://github.com/spring-projects/spring-batch/pull/4497)
Suggested Change
If we define the DELETE CASCADE option on each Foreign Key in the metadata table, we could remove all metadata by simply deleting the desired table row and the database will take care of the rest.
As far as I can see each supported database supports the DELETE CASCADE option