rg.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:
原先跑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:的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- org.hibernate.NonUniqueObjectException: a different object with the same identifier value was alread---------程序报错
今天遇到了这个问题: org.hibernate.NonUniqueObjectException: a different object with the same identifier value ...
- 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 ...
- hibernate 异常a different object with the same identifier value was already associated with the session
在使用hibernate的时候发现了一个问题,记录一下解决方案. 前提开启了事务和事务间并无commit,进行两次save,第二次的时候爆出下面的异常a different object with t ...
- org.hibernate.NonUniqueObjectException:a different object with the same identifier value was alread
转自: http://blog.csdn.net/zzzz3621/article/details/9776539 看异常提示意思已经很明显了,是说主键不唯一,在事务的最后执行SQL时,session ...
- 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"?> ...
- 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 ...
随机推荐
- Ubuntu 用户权限相关命令
目标 用户 和 权限 的基本概念 用户管理 终端命令 组管理 终端命令 修改权限 终端命令 01. 用户 和 权限 的基本概念 1.1 基本概念 用户 是 Linux 系统工作中重要的一环,用户管理包 ...
- Flask之WTfroms组件
一.WTfroms简介 WTForms插件是类似于django的form组件的插件,可以帮我们写标签,校验数据等. 二.安装与使用 安装: pip install WTForms 使用: from w ...
- Spark 宽窄依赖和stage的划分
窄依赖 父RDD和子RDD partition之间的关系是一对一的,或者父RDD一个partition只对应一个子RDD的partition情况下的父RDD和子RDD partition关系是多对一的 ...
- sqlite3入门之sqlite3_mprintf
sqlite3_mprintf sqlite3_mprintf()函数原型: char *sqlite3_mprintf(const char*,...); sqlite3_mprintf()的作用是 ...
- 在输出debug日志前加上logger.isDebugEnabled()判断的原因
场景: String token = md5.substring(0, 10) + base64Two + md5.substring(10); if (logger.isDebugEnabled() ...
- LG4195 【模板】exBSGS
exBSGS 已知数\(a,p,b\),求满足\(a^x≡b\ (\bmod p)\)的最小自然数\(x\). \(100\%\)的数据,\(a,p,b≤10^9\). _皎月半洒花的题解 其实本质上 ...
- try catch 场景
面试官:什么情况下用到try-catch?程序员:代码执行预料不到的情况,我会使用try-catch.面试官:什么是预料不到的情况呢?程序员:比如我要计算a除以b,但是b是变量,如果b等于0程序就会出 ...
- 2019-2020-1 20199302《Linux内核原理与分析》第三周作业
云班课学习内容 一.C语言中嵌入汇编代码 1.内嵌汇编语法 (1)C语言中嵌入汇编代码的写法: asm( 汇编语句模板: 输出部分: 输入部分: 破坏描述部分): 说明:输出部分和输入部分对应着C语言 ...
- AtomicIntegerFieldUpdater字段原子更新类
本文链接:https://blog.csdn.net/anLA_/article/details/78662383前面讲的两个AtomicInteger和AtomicIntegerArray,这两个都 ...
- CSS渐变色边框,解决border设置渐变后,border-radius无效的问题
需求:用css设置渐变边框通过border-image来实现渐变色边框 <div class="content"></div> .content { wid ...