Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Fwd: Spring managed transactions, EclipseLink JPA, custom isolation level

Hi,

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 SERIALIZABLE 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/comitting 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... Is there a way to do what I am trying to?

Thanks,
m


Back to the top