-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Stefan Schmidt opened SPR-5033 and commented
This issue is a side effect of #8051.
HibernateTemplate should detect a HibernateTransactionManager-driven transaction where the transactional Session is obtained through a custom SessionFactory proxy.
In the JTA case, there are no guarantees that openSession() will be called through the proxy in the first place since Hibernate's own JTA support uses internal calls on the SessionFactory there.
However, Hibernate's own CurrentSessionContext implementations will keep using the native SessionFactory object directly. Native sessionFactory.getCurrentSession() calls will always bypass the custom
SessionFactory proxy's openSession() method. The custom proxy needs to intercept and handle getCurrentSession() calls accordingly as well.
Affects: 2.5.5
Issue Links:
- HibernateTemplate doesn't work with Transactions externally managed behind hibernates getCurrentSession() [SPR-3367] #8051 HibernateTemplate doesn't work with Transactions externally managed behind hibernates getCurrentSession()