org.springframework.dao.DuplicateKeyException: a different object with the same identifier value was already associated with the session: [cn.honry.base.bean.model.DrugStorage#402880a45437a18e015437b564c30050]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [cn.honry.base.bean.model.DrugStorage#402880a45437a18e015437b564c30050]

 

 

项目的用的是SSH ,数据库层继承的是spring提供的扩展hibernate的一个API-GenericDaoHibernate类
报了一个这个错误,虽然很快就查出了问题,但也记录下,以后碰到就省去了debug吧.
这个问题的话原因是在调用持久层类的进行保存域更新的时候,主键或唯一性约束冲突了.

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2021-05-10
  • 2021-08-24
相关资源
相似解决方案