Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSpring managed transactions, EclipseLink JPA, custom isolation level
https://www.eclipse.org/forums/index.php/mv/msg/781925/1386629/#msg_1386629
I have a Spring application with Spring-managed transactions. It uses EclipseLink JPA. I have a method which does a findByNativeQuery() followed by a merge(). I need this to happen in a real SERIAL transaction isolation level. I tried adding @Transactional(isolation=Isolation.SERIALIZABLE)
This doesn't work because org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect#beginTransaction
does not support any transaction isolation level but the default. So then I tried getting to UnitOfWork internals of ElcipseLink and starting/committing my own transactions, but then I get an error:
"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 do I do??]]>M K2014-06-18T20:28:40-00:00