Spring boot and Hibernate session context

ZeroTurnaround Homepage Forums JRebel Support Spring boot and Hibernate session context

Tagged: , ,

This topic contains 0 replies, has 1 voice, and was last updated by  Krzysztof Majewski 4 months, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
  • #62653

    This is my SpringBoot app with @Bean configuration for SessionFactory:

    public class BooksListApplication {
    	public static void main(String[] args) {
    		SpringApplication.run(BooksListApplication.class, args);
    	public SessionFactory sessionFactory(HibernateEntityManagerFactory hemf) {
    		return hemf.getSessionFactory();

    my configuration:

    spring.datasource.url= jdbc:postgresql://localhost:5432/books

    And my Dao class:

    public abstract class AbstractDao<T> implements CrudRepository<T, Long> {
        private SessionFactory sessionFactory;
        public <S extends T> S save(S entity) {
            return entity;

    save() method ends up with org.hibernate.HibernateException: No CurrentSessionContext configured!

    because configuration:


    is never loaded. It works fine with IntelliJ defult deburger. Problem exists onlny while running with JRebel debuger.

    Property should be loaded in org.hibernate.internal.SessionFactoryImpl:1219 from hibernate 5.0.12 but it loads as null

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.