-->
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.  [ 1 post ] 
Author Message
 Post subject: composite ID MANY-ONE relations delete
PostPosted: Thu Apr 10, 2008 1:33 pm 
Newbie

Joined: Thu Apr 10, 2008 10:02 am
Posts: 1
Hi I am Kind of new to Hibernate.
I am using composite ID in a child class which is mapped one to many with parent class. I am trying to update a particular instance of child class by deleting it and re inserting the new instance. Hibernate is throwing the following error while deleting. I tried with cascade:all-delete-orphan, cascade : all. If I make cascade:none in parent class it will delete but it won't insert. Is there any work around. Thanks In advance

Parameters: from ScourHighFlowEventDetails s where s.scourHighFlowEventDetailsID.BRKey.BRKey='63163031000B030'and s.scourHighFlowEventDetailsID.dateAndTimeMonitored=TO_DATE('04/24/2008','MM/DD/YYYY ')order by s.scourHighFlowEventDetailsID.dateAndTimeMonitored desc
[4/10/08 10:38:01:710 EDT] 2b852b85 HibernateFind E gov.mdot.bows.finders.HibernateFinder TRAS0014I: The following exception was logged org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [gov.mdot.bows.hibernate.businessobjects.ScourActionPlanDetail#gov.mdot.bows.hibernate.businessobjects.ScourID@886980ec]
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java)
at org.hibernate.exception.NestableRuntimeException.<init>(NestableRuntimeException.java:100)
at org.hibernate.UnresolvableObjectException.<init>(UnresolvableObjectException.java:23)
at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:742)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:166)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:468)
at org.hibernate.engine.Cascades$5.cascade(Cascades.java:154)
at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:771)
at org.hibernate.engine.Cascades.cascade(Cascades.java:720)
at org.hibernate.engine.Cascades.cascadeCollection(Cascades.java:895)
at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:792)
at org.hibernate.engine.Cascades.cascade(Cascades.java:720)
at org.hibernate.engine.Cascades.cascade(Cascades.java:847)
at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:121)
at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:112)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:59)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:39)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:711)
at org.hibernate.impl.SessionImpl.prepareQueries(SessionImpl.java:895)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:885)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at gov.mdot.bows.finders.HibernateFinder.findAll(HibernateFinder.java:53)
at gov.mdot.bows.common.finders.BaseFinder.findAll(BaseFinder.java:51)
at gov.mdot.bows.common.finders.ScourActionDetailsFinder.findHighFlowEventDetailsByPlanAndDate(ScourActionDetailsFinder.java:48)
at gov.mdot.ejb.bows.session.ScourActionPlanBean.updateScourActionPlan(ScourActionPlanBean.java)
at gov.mdot.ejb.bows.session.EJSRemoteStatelessScourActionPlan_093d9867.updateScourActionPlan(EJSRemoteStatelessScourActionPlan_093d9867.java:97)
at gov.mdot.ejb.bows.session._ScourActionPlan_Stub.updateScourActionPlan(_ScourActionPlan_Stub.java:361)
at gov.mdot.bows.process.delegate.ScourPlanActionDelegate.updateScourActionPlan(ScourPlanActionDelegate.java:66)
at gov.mdot.webapp.mbis.control.action.SaveScourPlanAction.execute(SaveScourPlanAction.java:48)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.mdot.webapp.framework.struts.MDOTActionServlet.process(MDOTActionServlet.java:103)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:61)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1006)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:589)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:209)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:121)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:280)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java)


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

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.