[Hibernate]a different object with the same identifier value was already associated with the session
来源:互联网 发布:宿舍用品淘宝店 编辑:程序博客网 时间:2024/06/11 16:21
在同一个session内,如果已经有一个对象已经是持久化状态(load进来等),现在构造一个新的PO,和前一个持久化对象拥有相同的持久化标识(identifier),在update的时候,就会抛这个错误。
解决方法
1.如果是hibernate3以上,可以使用session.merge()方法
2.把session中同标识的对象移出(session.evict(user1)),使他成为脱管的状态,然后user2就可以update了。
- Hibernate Exception: a different object with the same identifier value was already associated with the session
- Hibernate更新a different object with the same identifier value was already associated with the session
- [Hibernate]a different object with the same identifier value was already associated with the session
- Hibernate:a different object with the same identifier value was already associated with the session
- hibernate a different object with the same identifier value was already associated with the session
- Hibernate :A different object with the same identifier value was already associated with the session
- hibernate:a different object with the same identifier value was already associated with the session
- 解决a different object with the same identifier value was already associated with the session错误
- 解决a different object with the same identifier value was already associated with the session错误
- a different object with the same identifier value was already associated with the session的解决办法
- 解决a different object with the same identifier value was already associated with the session错误
- a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- 解决a different object with the same identifier value was already associated with the session错误
- a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- 再次碰到:a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- wamp覆盖安装后出现的一点问题
- 清空SQL Server数据库中所有表数据的方法
- STM32 IAP
- Java7新特性(四)并发 7 ScheduledThreadPool
- 将jre限制不能用的包启用方法。 sun.net.ftp.FtpClient
- [Hibernate]a different object with the same identifier value was already associated with the session
- iOS开发之详解剪贴板
- delphi7的基础语法
- Java Socket实战之三 传输对象
- Google chrome浏览器的十个秘密页面
- YUV(一)-数据格式分析
- android开发 drawable(hdpi,mdpi,ldpi)的区别
- Sky Map
- go语言编写,简单聊天室程序 1