Im using SpringBatch 2.1.7 release core and Infrastructure jars to read a CSV file and save it to DB.
Integrated my code with Spring quartz scheduler to run for every minute, The Batch is working fine with reading and writing but its failing with the error "org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=1 with wrong version (2), where current version is 1"
due to Tx conflicts. Please suggest how can i resolve this issue.
I had this same exception.
org.springframework.dao.OptimisticLockingFailureException:
Attempt to update step execution id=0 with wrong version (2), where current version is 3
In my case, it was caused by a failure the process step, which was being swallowed. Spring Batch activated the writer, even though the processor had failed. Look through your logs to make sure that your process step is completing and returning something.