Transaction not successfully started&&Could not commit Hibernate transaction;

Posted kasher

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Transaction not successfully started&&Could not commit Hibernate transaction;相关的知识,希望对你有一定的参考价值。

记录一下这个问题,解决方法是分两种情况,

一种是getCurrentSession();这种情况加入配置:
<property name="hibernate.current_session_context_class">thread</property>

一种是:getSession的

在修改操作后加上

finally
   {   
    session.close();   
   }





以上是关于Transaction not successfully started&&Could not commit Hibernate transaction;的主要内容,如果未能解决你的问题,请参考以下文章

异常:Transaction not successfully started

save is not valid without active transaction

win7 sp1 Error_transaction_not_active

编程异常——假设你报createSQLQuery is not valid without active transaction,...

Could not open Hibernate Session for transaction

事务配置不对导致:?Could not obtain transaction-synchronized Session for current thread