I need to update my database before the Step starts and when it is complete. The purpose is to track in the database which processes are running at any one time. Before the step runs, it would insert a records; after the step completes, it will delete the record. Not elegant, but it's the requirement I have.
My idea was to implement this as a StepExecutionListener, issuing the insert and delete statements in the beforeStep and afterStep. This would also allow me to leverage the DataSource defined for the Job.
What if any are the drawbacks to this approach? Are there other hooks in the framework which would better solve this problem?