79391124

Date: 2025-01-27 14:28:30
Score: 0.5
Natty:
Report link

There is very probably an exception or some other problem marking the transaction as rollbackOnly. You have to figure what is this problem. Eventually flush the EntityManager manually to get sooner a database exception.

I advise again defining transaction yourself with @Transactional(propagation = Propagation.REQUIRES_NEW) as proposed by @Rakesh Gurung. Spring Batch already manages transaction, also for Tasklet, so better not interfere (or really needing it and knowing the pitfalls). About Spring Batch Tasklet: https://docs.spring.io/spring-batch/reference/step/tasklet.html

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Rakesh
  • Low reputation (0.5):
Posted by: Florian H.