| Thanks for trying to help me. I do save PaymentDO before PaymentBatchJob. (see my comment above “What I want to do is saving a PaymentDO and then add a PaymentBatchJobDO to it (using Spring's JpaRepository). Strangely when trying to save the PaymentBatchJobDO this fails.“) The code worked with hibernate-core 5.3.* but no longer with hibernate-core 5.4.*. As you can see Spring is calling EntityManager.merge which leads to this issue. As a workaround I managed now that in that case EntityManager.save gets called. |