Skip to content

HibernateTemplate does not consistently detect pre-bound Session when using a custom SessionFactory proxy [SPR-5033] #9708

@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions