I am using latest stable Spring version (4.2.6.RELEASE
).
After upgrading Hibernate from 5.1 to 5.2 and changing hibernate-entitymanager
dep
The issue is related to the versions only.
Use Hibernate version 5.1.0 with Spring 4.3.7. It will solve this issue.
Add the below dependency along with Spring framework dependencies of version 4.3.x .
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.1.0.Final</version>
</dependency>`
methods are
applyFlushModeHint
protected boolean applyFlushModeHint(FlushMode flushMode)
Apply the FlushMode hint.
Parameters:
flushMode - The FlushMode value specified as hint
Returns:
true if the hint was "applied"
Where FlushMode can be
ALWAYS The Session is flushed before every query.
AUTO The Session is sometimes flushed before query execution in order to ensure that queries never return stale state.
COMMIT The Session is flushed when Transaction.commit() is called.
MANUAL The Session is only ever flushed when Session.flush() is explicitly called by the application.
NEVER Deprecated. use MANUAL instead.
Hibernate 5.2
supports added in Spring framework 4.3
, that its stable version will be available in next week.
Spring 4.2 only supports Hibernate up to 5.1.
see this:
https://jira.spring.io/browse/SPR-14334