Hibernate spring annotation sessions not being closed/flushed

后端 未结 4 1853
情书的邮戳
情书的邮戳 2021-01-07 08:04

I\'ve \'inherited\' a project which uses Spring annotations to manage transactions/sessions with Hibernate. Or at least it\'s meant to be. Currently the Hibernate sessions n

4条回答
  •  半阙折子戏
    2021-01-07 08:26

    using hibernate template solves it

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
           hibernateTemplate = new HibernateTemplate(sessionFactory);
    }
    

    and then use the template like in this link http://singgihpraditya.wordpress.com/2010/02/13/spring-3-0-and-hibernate-tutorial-part-1/

    your reply would be great to share

提交回复
热议问题