Session#setHibernateFlushMode() method not callable without an active transaction

Description

Starting from hibernate 5.2, method SharedSessionContractImplementor#setFlushMode() is deprecated in favor of #setHibernateFlushMode() (to avoid naming collision with JPA..).

While setFlushMode() is allowed to be called without an active transaction (an open session in enough), method setHibernateFlushMode() is not allowed to do so.
This is due to ThreadLocalSessionContext proxy InvocationHandler, that allows setFlushMode() and do not allow setHibernateFlushMode() (line 334).

Environment

Windows 10
Hibernate 5.4.6
HikariCP 3.4.1
MSSQL 2017

Status

Assignee

Luca Domenichini

Reporter

Luca Domenichini

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

Yes, likely

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure