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

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

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

一种是:getSession的

在修改操作后加上

finally
   {   
    session.close();   
   }

posted @ 2017-07-13 23:16  kasher  阅读(395)  评论(0编辑  收藏  举报