org.springframework.dao.DuplicateKeyException: A different object with the same identifier value was already associated with the session : [com.chuai.pojo.Department#14]; nested exception is org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [com.chuai.pojo.Department#14]
解决:
使用ssh框架进行update()操作的时候,出现id被占用的情况,查询资料得知是hibernate一级缓存的缘故,可在update之前,去dao层调用clera()方法清除session
NonUniqueObjectException: A different object with the same identifier value was already associated
最新推荐文章于 2023-07-26 10:38:43 发布