Why do I get org.hibernate.HibernateException: No CurrentSessionContext configured

前端 未结 3 1718
误落风尘
误落风尘 2020-12-15 04:56

I\'m writing a simple project, a business app written in Swing, using Hibernate for back-end. I come from Spring, that gave me easy ways to use hibernate and transactions. A

3条回答
  •  眼角桃花
    2020-12-15 05:52

    I faced the same problem when I am working on a portal where I am using spring remoting with hibernate. This kind of problem arise only if when the called service method contains multiple DAO calls that hit database with hibernate session.

    And the solution is set the @Transaction annotation for those methods with multiple DAO calls. (Implies all the DOA calls with in this method should be under one transaction.)

提交回复
热议问题