- 博客(1)
- 收藏
- 关注
原创 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有三种状态:临时态、持久态、游离态。持久态保存在会话里,因此我认为错误原因应该是saveOrUpdate的之前执行过相同主键的对象操作,致使session中已含有相同主键的对象。②将相同主键持久化对象转化为游离态。
2023-07-26 10:38:43
598
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人