-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: identifier of an instance altered from x to y
PostPosted: Tue Jan 18, 2005 3:16 pm 
Newbie

Joined: Tue Jan 18, 2005 2:08 pm
Posts: 2
I need some hints as to what might be causing my identifier to change. In no place in my code do I manually setId on any of my instances..

Thank You

Hibernate version:
latest release

Full stack trace of any exception that occurs:

Caused by: net.sf.hibernate.HibernateException: identifier of an instance of com.springboard.enrapture.om.Account altered from 12 to 0
at net.sf.hibernate.impl.SessionImpl.checkId(SessionImpl.java:2662)
at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2485)
at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2478)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2280)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1814)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1577)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1542)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1530)
at com.springboard.enrapture.persistence.hibernate.HibernatePersistenceManager.find(HibernatePersistenceManager.java:256)
... 69 more


Name and version of the database you are using:
postgresql 7.1.2


The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: also, this only happens on updates
PostPosted: Tue Jan 18, 2005 3:20 pm 
Newbie

Joined: Tue Jan 18, 2005 2:08 pm
Posts: 2
So I do not get this error when saving a brand new object, but if I have selected out an existing object and modify it in some way, the error is thrown.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 18, 2005 3:23 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
add a breakpoint in the setter and play your use case on debugger

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: instance altered
PostPosted: Tue Feb 01, 2005 9:15 am 
Newbie

Joined: Sun Aug 29, 2004 3:31 pm
Posts: 8
Please has anyone solved thi problem? I got this trace and I have no idea what should be wrong:
Code:
identifier of an instance of org.appfuse.model.Town altered from 10100 to 79601; nested exception is net.sf.hibernate.HibernateException: identifier of an instance of org.appfuse.model.Town altered from 10100 to 79601


Satck trace:
Code:
[appfuse] WARN [http-8080-Processor23] DispatcherServlet.doService(609) | Handler execution resulted in exception - forwarding to resolved error v
org.springframework.orm.hibernate.HibernateSystemException: identifier of an instance of org.appfuse.model.Town altered from 10100 to 79601; neste
net.sf.hibernate.HibernateException: identifier of an instance of org.appfuse.model.Town altered from 10100 to 79601
        at net.sf.hibernate.impl.SessionImpl.checkId(SessionImpl.java:2662)
        at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2485)
        at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2478)
        at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2280)
        at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2259)
        at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
        at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:464)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:376)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:24
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:143)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
        at $Proxy47.saveTransportRequest(Unknown Source)
        at org.appfuse.webapp.action.TransportRequestFormController.onSubmit(TransportRequestFormController.java:69)
        at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:224)
        at org.appfuse.webapp.action.BaseFormController.processFormSubmission(BaseFormController.java:157)
        at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:230)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:584)
        at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:366)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:326)
        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:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.appfuse.webapp.filter.GZIPFilter.doFilter(GZIPFilter.java:51)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.appfuse.webapp.filter.ActionFilter.doFilter(ActionFilter.java:116)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 9:52 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
No way, you must have been changing the id of instance in somewhere,
Write System.err.println("setID called") in your setID method and re-run

_________________
-developer


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.