Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Delete data from Spring Batch Metadata tables that are 90 days old. [BATCH-1747] #1844

Closed
spring-issuemaster opened this issue May 10, 2011 · 3 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 10, 2011

Mariam opened BATCH-1747 and commented

I want to write stored procedure to delete records that are created in spring batch metadata. Can you please let me know the query to do it. I need to delete data that are 90 days old. We are using oracle as DB.


Affects: 2.1.5

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 10, 2011

Mariam commented

I want to delete records from all Batch_XXX tables based on last_updated date in batch_job_execution table.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 10, 2011

Lucas Ward commented

I'm closing as won't fix, as this issue is much more appropriate to ask on the forum(it's not an issue, it's a question). However, I'm assuming you're having issues because of the foreign key constraints. You have three options:

  1. remove the constraints
  2. Delete in the correct order, such that children are deleted before parent, in the case of SB it would be:
    batch_step_execution_context
    batch_step_execution
    batch_job_execution_context
    batch_job_execution
    batch_job_params
    batch_job_instance

As long as you remove from the bottom up, it will be fine.

  1. Update the constraints to support cascading delete.
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jun 26, 2012

Elryk commented

For all interested people, I have published on Github a tasklet that removes the Spring Batch historic:
https://github.com/arey/spring-batch...ryTasklet.java
I hope that may help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.