session.update(Object object)方法来对数据库进行更新的。而该方法在执行时,如果在session的缓冲区中存在与传入对象object有相同id的PO对象的话,就会抛出a different object with the same identifier value was already associated with the session.
解决办法:
用hql的方式直接对数据库进行修改
super.queryHql("update Customer u set u.email = ? where u.id = ?", obj);
参考文章
http://excon.iteye.com/blog/1085591
本文出自 “点滴积累” 博客,请务必保留此出处http://tianxingzhe.blog.51cto.com/3390077/1670923