ItemProcessor uses Hibernate for persitence. During processing of chunk the Database raises an exception (i.e. duplicate key - DataIntegrityViolationException).
Hibernate caches all updates until commit point. This causes that the database exception is raised during database commit (in TransactionTemplate) not in ChunkOperations.iterate(). ExceptionHandler in ChunkOperatons (RepeatTemplate) cannot handle this exception because it occurs after chunk is finnished (this is not synchronous with processing of the bad record).
This way we are unable to handle bad records (to skip them) and the whole batch job fails.
See example in attached zip file (hibernate job).