Spring managed transactions, EclipseLink JPA, custom isolation level [message #1386629] |
Wed, 18 June 2014 20:28 |
M K Messages: 1 Registered: June 2014 |
Junior Member |
|
|
I suspect this one is embarrassing an I am doing it wrong in a terrible way, but please bear with me.
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??
|
|
|
Powered by
FUDForum. Page generated in 0.03435 seconds