How can I "restore" data in DB after start Spring boot?
For example - when my server shutdown, some rows remain in NEW status. I need change status to another, when start server. The first thing that comes to mind is to call the method in @PostConstruct:
@PostConstruct
public void init() {
someService.prepareForExecution();
}
But it seems to me wrong. I can also run another Sheduller which will be updated.
But I must be sure that before the server starts up, all data will be restored to normal. how to do it right?