zoukankan      html  css  js  c++  java
  • org.springframework.dao.DuplicateKeyException

    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吧.
    这个问题的话原因是在调用持久层类的进行保存域更新的时候,主键或唯一性约束冲突了.
  • 相关阅读:
    redis
    JSP
    Cookie&Session
    Servlet
    HTTP
    TomCat
    CSS
    XML
    JDBC
    Mysql(对表的操作)
  • 原文地址:https://www.cnblogs.com/xiaoqisfzh/p/5457529.html
Copyright © 2011-2022 走看看