I suspect this is embarrassing, that I am doing it wrong in a terrible way, but please carry me.
I have a Spring application with Spring-driven transactions. It uses the EclipseLink JPA. I have a method that executes findByNativeQuery() , followed by merge() . I need this to happen at the real level of transaction isolation SERIAL. I tried adding @Transactional(isolation=Isolation.SERIALIZABLE)
This does not work because org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect#beginTransaction does not support transaction isolation level, but by default. So, I tried to connect to UnitOfWork ElcipseLink modules and start / commit my own transactions, but then I get an error message:
"java.lang.IllegalStateException : Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead
Which, of course, makes sense ... but what should I do?
source share