-->
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.  [ 3 posts ] 
Author Message
 Post subject: all-delete-orphan fails with list :hibernate 3.1
PostPosted: Mon Oct 02, 2006 8:11 am 
Newbie

Joined: Mon Oct 02, 2006 7:51 am
Posts: 2
I am using hibernate 3.1 jar.
My mapping file is as follows:
<class name="QuestionnaireElement"
table="GME_QUESTIONNAIRE_ELEMENT" discriminator-value="QE"
lazy="false">
<id name="id" column="QUESTIONNAIRE_ELEMENT_ID"
unsaved-value="null">
<generator class="native">
<param
name="sequence">GME_SEQ_QUEST_ELEMENT_ID</param>
</generator></id>
<discriminator type="string"
column="TYPE"></discriminator>
<map name="labels" lazy="false" table="GME_LABEL" cascade="all">
<key column="QUESTIONNAIRE_ELEMENT_ID"/>
<index-many-to-many column="LANG_ID"
class="com.barcap.gcs.gmevents.model.reference.Language"/>
<composite-element class="Label">
<property name="name" column="TEXT" />
<property name="guestText" column="SECONDARY_TEXT" />
</composite-element></map>
<list name="rules" lazy="true" inverse="true" cascade="all">
<key column="PARENT_ID" not-null="true" update="false"/>
<list-index column="POSITION"/>
<one-to-many class="Rule" />
</list>
<subclass name="TextBlock" discriminator-value="TX">
-----
</subclass>
---
</class>

WHen I create a Question for the first time it dows not throw any exception, however, when I update the same question (nothing is set on the rules list) it throws an exception-
- Unhandled Exception thrown: class
org.springframework.orm.hibernate3.HibernateSystemException
2006-10-02 19:09:59,500 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/gmevent
s].[action]] - Servlet.service() for servlet action threw exception
org.springframework.orm.hibernate3.HibernateSystemException: A
collection with cascade="all-delete-orphan" was no longer referenced by
the owning entity instance:
com.barcap.gcs.gmevents.model.questionnaire.QuestionnaireElement.rules;
nested exception is org.hibernate.HibernateException: A collection with
cascade="all-delete-orphan" was no longer referenced by the owning
entity instance:
com.barcap.gcs.gmevents.model.questionnaire.QuestionnaireElement.rules
org.hibernate.HibernateException: A collection with
cascade="all-delete-orphan" was no longer referenced by the owning
entity instance:
com.barcap.gcs.gmevents.model.questionnaire.QuestionnaireElement.rules
at
org.hibernate.engine.Collections.processDereferencedCollection(Collectio
ns.java:96)
at
org.hibernate.engine.Collections.processUnreachableCollection(Collection
s.java:39)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushCollections(A
bstractFlushingEventListener.java:217)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToE
xecutions(AbstractFlushingEventListener.java:77)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEv
entListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:10
6)
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(
HibernateTransactionManager.java:584)
at
org.springframework.transaction.support.AbstractPlatformTransactionManag
er.processCommit(AbstractPlatformTransactionManager.java:496)
at
org.springframework.transaction.support.AbstractPlatformTransactionManag
er.commit(AbstractPlatformTransactionManager.java:469)
at
org.springframework.transaction.interceptor.TransactionAspectSupport.doC
ommitTransactionAfterReturning(TransactionAspectSupport.java:266)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invok
e(TransactionInterceptor.java:106)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:170)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAo
pProxy.java:176)
at $Proxy11.saveOrUpdate(Unknown Source)
at
com.barcap.gcs.gmevents.web.questionnaire.ManageQuestionsAction.save(Man
ageQuestionsAction.java:438)
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.struts.actions.DispatchAction.dispatchMethod(DispatchAction.j
ava:274)

Thanks in advance for help


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 11:36 am 
Newbie

Joined: Thu Sep 28, 2006 12:27 pm
Posts: 13
I strongly suggest you to make use of the code-tag when you post Java, XML and the like.

Can you post the Javacode from the creation of your QuestionnaireElement-Object up to the error?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 9:26 pm 
Newbie

Joined: Mon Oct 02, 2006 7:51 am
Posts: 2
Thanks! I could get rid of the problem. I put a test condition at setRules() and that is how it was failing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.