Description
Eugen Paraschiv opened SPR-8959 and commented
Setting the readOnly flag to true when Spring is configured with JPA (JpaTransactionManager, LocalContainerEntityManagerFactoryBean) with Hibernate (3.6.8) as provider works fine. When migrating to Hibernate 4 (still with the same JPA configuration) the readOnly doesn't have any effect any more. After a bit of debugging it seems that, when the underlying connection is prepared, it no longer gets marked as read only, so no exception is thrown, which means that the operation is indeed executed.
This should be easy to test, but if needed I can provide a sample project.
I will also mention that I am using MySQL.
Affects: 3.1 GA
Issue Links:
- OpenEntityManagerInViewInterceptor doesn't always close connections with WildFly 8 [SPR-12118] #16734 OpenEntityManagerInViewInterceptor doesn't always close connections with WildFly 8
- Isolation support for JPA with Hibernate EntityManager 4 [SPR-11942] #16559 Isolation support for JPA with Hibernate EntityManager 4
- HibernateJpaDialect should warn about connection release mode other than ON_CLOSE (when upgrading from 4.0.x) [SPR-13269] #17860 HibernateJpaDialect should warn about connection release mode other than ON_CLOSE (when upgrading from 4.0.x)
Referenced from: commits 0280a2a, 5452144, 562916b, 8a5e47a, cbda722
2 votes, 10 watchers