-->
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: Exception: A collection with cascade="all-delete-orphan"
PostPosted: Wed May 06, 2009 3:14 pm 
Newbie

Joined: Fri Sep 30, 2005 12:45 am
Posts: 8
Hi All,
I am getting the following exception: "A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance:" only under one scenario.
We can open multiple panels and update it in our app., this exception is occurring only when I have multiple panels open and update a panel and save the obj.
If I have just one panel open and directly modify and save this exception does not occur.
I have looked into the forums regarding this exception and it is mentioned that the exception may occur only if the reference of the Child list owned by the parent is changed. I checked the getter/setter methods and the addToCollection methods to make sure this is not the case:
Code:
<bag embed-xml="true" name="HierarchyNodeList" optimistic-lock="true" cascade="all,delete-orphan">
   <key column="SAK_THREAD" on-delete="noaction"> </key>
   <one-to-many class="HierarchyNode" embed-xml="true"/>
</bag>
public List getHierarchyNodeList ()
{
   return this.hierarchyNodeList;
}
public void setHierarchyNodeList (List hierarchyNodeList)
{
   this.hierarchyNodeList = hierarchyNodeList;
}

public void addToHierarchyNodeList (gov.ma.eohhs.newmmis.ref.model.HierarchyNode hierarchyNode)
{
   if (null == getHierarchyNodeList())
   {
      this.setHierarchyNodeList(new ArrayList());
   }
   if(hierarchyNode != null)
   {
      this.getHierarchyNodeList().add(hierarchyNode);
   }
      
}

I have also checked to make sure the reference of the list remains the same during save. I am not sure why this error does not occur under all scenarios but only when I have multiple panels loaded.
Any feedback is appreciated.
Thanks.


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.