原先跑TEST CASE的时候没有出错

但是跑到整个程序里面,除了这个问题,

网上也找了下资料,说是用merge之类的可以解决,因为你这个update的obj和session里面的不用,所以导致此问题。

突然石化~~~想到session~~~想到TESTcase的时候没有用事物aop所以每个方法都是一个事物,所以当然没问题,而大程序里面用了事物,更新的是取出来的obj但是又多此一举的beanutils的copy了一下,导致不是一个obj了,但是session里面又有这个obj的id,故此问题发生~~~偶滴神啊。。最后TEST
CASE里面全加上加事务。

rg.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:的更多相关文章

  1. Exception 06 : org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session :

    异常名称: org.hibernate.NonUniqueObjectException: A different object with the same identifier value was ...

  2. org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:

    保存实体异常 https://blog.csdn.net/zzzz3621/article/details/9776539 org.hibernate.NonUniqueObjectException ...

  3. org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session异常解决办法

    org.hibernate.NonUniqueObjectException: a different object with the same identifier value was alread ...

  4. org.hibernate.NonUniqueObjectException: a different object with the same identifier value was alread---------程序报错

    今天遇到了这个问题: org.hibernate.NonUniqueObjectException: a different object with the same identifier value ...

  5. Hibernate Error: a different object with the same identifier value was already associated with the session

    在执行Hibernate的Update操作时,报错:a different object with the same identifier value was already associated w ...

  6. hibernate 异常a different object with the same identifier value was already associated with the session

    在使用hibernate的时候发现了一个问题,记录一下解决方案. 前提开启了事务和事务间并无commit,进行两次save,第二次的时候爆出下面的异常a different object with t ...

  7. org.hibernate.NonUniqueObjectException:a different object with the same identifier value was alread

    转自: http://blog.csdn.net/zzzz3621/article/details/9776539 看异常提示意思已经很明显了,是说主键不唯一,在事务的最后执行SQL时,session ...

  8. hibernate中一种导致a different object with the same identifier value was already associated with the session错误方式及解决方法

    先将自己出现错误的全部代码都贴出来: hibernate.cfg.xml <?xml version="1.0" encoding="UTF-8"?> ...

  9. Hibernate更新数据报错:a different object with the same identifier value was already associated with the session: [com.elec.domain.ElecCommonMsg#297e35035c28c368015c28c3e6780001]

    使用hibernate更新数据时,报错 Struts has detected an unhandled exception: Messages: a different object with th ...

随机推荐

  1. SQL SERVER-AlwaysonResolving

    虽然2台都是同步提交,自动failover模式 在辅助副本的AG中先删掉一个可用DB,然后关闭主副本,之后辅助副本变为下图.不能自动failover. 重新开启主副本后,主副本显示一切正常 但是辅助副 ...

  2. c# Stack 类

  3. 蓝桥杯-入门训练 :Fibonacci数列

    问题描述 Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1.当n比较大时,Fn也非常大,现在我们想知道,Fn除以10007的余数是多少. 输入格式 输入包含一个整数n. ...

  4. XPath知识点【一】

    什么是 XPath? XPath 使用路径表达式在 XML 文档中进行导航 XPath 包含一个标准函数库 XPath 是 XSLT 中的主要元素 XPath 是一个 W3C 标准 XPath 路径表 ...

  5. React系列,初识

    学习react对于新手来说,还没有学react往往就会被webpack,npm等搞的晕头转向,所以我们今天就从最简单的方式入手 <script src="react.js"& ...

  6. 基于ATtiny85微控制器制作一款四通道温度计

    本文主要介绍了一款基于ATtiny85微控制器的四通道温度计,该温度计可以同时监测四个温度传感器的温度,并且实时在小型128x32 OLED液晶屏上进行显示. 该温度计可以用于任何需要监控多个温度点的 ...

  7. 【转】Http和Https下的cookie的写入问题

    网站https:// 可以登陆, 但是切换到http的时候不能登陆. 原因是:https访问的时候,返回的cookie设置了secure=1, 切换成http访问的时候, 这个时候不能操作那个cook ...

  8. BZOJ4659: Lcm

    Description 给出A,B,考虑所有满足l<=a<=A,l<=b<=B,且不存在n>1使得n^2同时整除a和b的有序数 对(a,b),求其lcm(a,b)之和.答 ...

  9. Spring源码窥探之:@Value

    1. 首先定义实体 /** * @author 70KG * @Title: Apple * @Description: 苹果实体 * @date 2018/10/22下午9:26 * @From w ...

  10. python - 一键复习知识点

    ## rest规范:    通过不同的 method 找到对应的 url ## Django 请求生命周期 - wsgi ,它就是socket 服务端,服务端接收用户请求并将请求初次封装,然后交给 D ...