Spring/Hibernate Exception: createCriteria is not valid without active transaction

后端 未结 1 1928
时光取名叫无心
时光取名叫无心 2020-12-31 18:16

I spent few days on an spring-hibernate-transaction issue. I create a simple webservice with jaxws + spring + hibernate, it works fine but when I call a web methode which us

相关标签:
1条回答
  • 2020-12-31 18:41

    Ok I found the problem ! I removed this line from the hibernate configuration. Spring manages the transaction, and it doesn't need of that the session is holding in a hibernate thread.

    <!-- Bind the getCurrentSession() method to the thread. -->
    <property name="current_session_context_class">thread</property>
    
    0 讨论(0)
提交回复
热议问题