Is there any way to persist some data in database after an exception occurs in ItemWriter in spring batch?
问题 I want to persist some data after an exception occurs in ItemWriter step. But if I am not incorrect, in this case a rollback would happen and so this persisting logic won't work.Is there any way to achieve this? Right now, I am implementing itemWriteListener and all the persisting logic is written inside onWriteError method. This logic only concerns to change state of some entities to error. 回答1: You'll want to use a separate connection that does not participate in the transaction. For