梦开始的地方----

梦延续的港湾----

常用链接

统计

积分与排名

最新评论

征集hibernate错误答案

Q:identifier of an instance of com.lanhan.poos.vo.Ck was altered from 1 to 2; nested exception is org.hibernate.HibernateException: identifier of an instance of com.lanhan.poos.vo.Ck was altered from 1 to 2
Stack Trace is :

org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of com.lanhan.poos.vo.Ck was altered from 1 to 2; nested exception is org.hibernate.HibernateException: identifier of an instance of com.lanhan.poos.vo.Ck was altered from 1 to 2
Caused by: org.hibernate.HibernateException: identifier of an instance of com.lanhan.poos.vo.Ck was altered from 1 to 2
 at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:51)
 at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
 at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
 at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
 at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
 at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
 at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
 at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
 at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
 at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:580)
 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:539)
 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:509)
 at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:275)
 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
 at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:647)
 at com.lh.pos.dao.impl.BorrowDAOImpl$$EnhancerByCGLIB$$61171362.updateBorrow()
 at com.lh.pos.web.ck.BorrowController.update(BorrowController.java:152)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
 at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:162)
 at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:114)
 at com.lh.pos.web.ck.BorrowController.handleRequest(BorrowController.java:67)
 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:728)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExportFilter.java:49)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:151)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
 at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
 at java.lang.Thread.run(Unknown Source)

更新记录时出错以上错误,有知道问题的答案吗,很想搞清楚问题出在哪里

posted on 2006-08-19 22:12 梦延续的港湾----依然是蓝 阅读(2026) 评论(6)  编辑  收藏 所属分类: spring&hibernate

评论

# re: 征集hibernate错误答案[未登录] 2008-03-19 11:38 sting

我也遇到了同样的问题.Google了一把,好像是因为hbm里面id的type和java文件里面的不一样.
不过我代码里面都是String.而且linux不行,windows一直都正常...  回复  更多评论   

# re: 征集hibernate错误答案 2008-08-13 14:35 zhanghl

我也遇到了这样的问题 我的解决了
我的出现多对一映射中 son和parent的关系中 当我修改son时意外的把son.parent.id修改成其他的了 但是其他属性不变 hibernate 就会报对象的标识符从XX转变到XX的异常了  回复  更多评论   

# re: 征集hibernate错误答案[未登录] 2009-02-05 16:20 kevin

@zhanghl
怎么處理呢?我現在就是你這種情況.本人新學,謝謝了!  回复  更多评论   

# re: 征集hibernate错误答案[未登录] 2009-02-08 11:47 kevin

我現在也有這樣的情況 ~怎么處理呢?  回复  更多评论   

# re: 征集hibernate错误答案 2009-02-14 17:46 啊斯蒂芬

类的实例唯一,重新对类初始化。  回复  更多评论   

# re: 征集hibernate错误答案 2013-01-18 09:23 andy.wai

@zhanghl
杯具啊,没想到三年后还遇到这问题,请问这位兄弟是如何解决的?  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: