码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2017-07-14 00:32:05      阅读:254      评论:0      收藏:0      [点我收藏+]

标签:could   property   nat   on()   方法   amp   success   finally   nts   

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

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

一种是:getSession的

在修改操作后加上

finally
   {   
    session.close();   
   }

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

标签:could   property   nat   on()   方法   amp   success   finally   nts   

原文地址:http://www.cnblogs.com/kasher/p/7163711.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!