a different object with the same identifier value was already associated with the session
来源:互联网 发布:python 卡尔曼滤波 编辑:程序博客网 时间:2024/06/11 23:10
a different object with the same identifier value was already associated with the session
假设:A对象的主键id为1,并且已经绑定到了hibenate的session中。
这时又来了一个B对象,它的主键也为1。
当将B对象也邦定到session的使用,hibernate就会报这个错误。
原因是: A对象与B对象不是同一个对象,还都想让session管理,并映射到数据库的同一条记录上,这时hibernate不知道要哪一个对象了。
org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [com.emar.eqifa.domain.SuperRebateProduct#696]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.emar.eqifa.domain.SuperRebateProduct#696]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:744)
at com.emar.framework.hibernate.HibernateDao.saveOrUpdateEntity(HibernateDao.java:93)
at com.emar.eqifa.hibernate.SuperRebateProductHomeImpl.saveSuperRebateProduct(SuperRebateProductHomeImpl.java:29)
at com.emar.eqifa.facade.SuperRebateProductFacadeImpl.addSuperRebateProduct(SuperRebateProductFacadeImpl.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
- 解决a different object with the same identifier value was already associated with the session错误
- 解决a different object with the same identifier value was already associated with the session错误
- a different object with the same identifier value was already associated with the session的解决办法
- 解决a different object with the same identifier value was already associated with the session错误
- a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- 解决a different object with the same identifier value was already associated with the session错误
- a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- 再次碰到:a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- 解决a different object with the same identifier value was already associated with the session错误
- 解决a different object with the same identifier value was already associated with the session错误
- HibernateSystemException: a different object with the same identifier value was already associated with the session.
- a different object with the same identifier value was already associated with the session
- a different object with the same identifier value was already associated with the session
- 解决a different object with the same identifier value was already associated with the session
- 解决a different object with the same identifier value was already associated with the session错误
- UIWebView添加图片点击事件、调整字体大小与高度自适应的解决方法
- java springmvc 数据调用 highcharts
- css 代码规范
- [图论]最大流问题(Maximum flow)的定义
- “感恩节现象”正在蔓延,我们该如何抉择?
- a different object with the same identifier value was already associated with the session
- cocos2dx CCLabelTTF显示中文乱码
- yahoo base.css
- a test blog
- 第16周-完美数(改进版提高了效率)
- Redis order set 有序集合
- heartbeat实现nginx热备
- android sdk 无法运行或者报 "ANDROID_SWT"错误
- DLNA介绍(包括 UPnP)