首页 > 其他 > 详细

a different object with the same identifier value was already associated with the session.

时间:2015-07-04 16:49:37      阅读:232      评论:0      收藏:0      [点我收藏+]

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

a different object with the same identifier value was already associated with the session.

原文:http://tianxingzhe.blog.51cto.com/3390077/1670923

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!