In a Spring Boot (1.5.3) application I used to use the following configuration to be able to inject the Hibernate (5.0.12) session:
spring.jpa.properties.hibernate.current_session_context_class=
org.springframework.orm.hibernate4.SpringSessionContext
When I replace it with:
spring.jpa.properties.hibernate.current_session_context_class=
org.springframework.orm.hibernate5.SpringSessionContext
I get org.hibernate.LazyInitializationException: could not initialize proxy - no Session
quite immediately after the first request.
Why does using hibernate5.SpringSessionContext not work with Hibernate 5 ?