Re: Problem in propagateDeleteForObject: 'Array is empty' ?
François Frisch <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Check your delete rules the to-many relationship (flattened) needs to be nullify but the to- one to the intermediate table needs to be cascade, then the inverse to-one needs to be nullify. On 10-Jan-07, at 7:10 AM, Jürgen Lorenz Simon wrote: > Hello, > > I have a complex model, modelling a tree structure with persistence > in the > database. In the tree, it can be the case that a node has more than > one parent. > Assume the following configuration: > > N1.children = N2,N3,N4 > N2.children = N4,N5,N6 > > => N4.parents = N1,N2 > > When adding one child to more than one parents, then deleting one > of the > parent nodes, I get problems. Which means, when deleting N1 or N2, > I get > the following exception: > > 1) testValueNodeHierarchies > (com.tecc.avida.model.test.ValueNodeTests) > java.lang.IllegalArgumentException: Array is empty > at com.webobjects.foundation.NSArray.objectAtIndex(NSArray.java:510) > at com.webobjects.eocontrol._EOCheapCopyMutableArray.objectAtIndex > (_EOCheapCopyMutableArray.java:98) > at > com.webobjects.eocontrol.EOClassDescription.propagateDeleteForObject > (EOClassDescription.java:516) > at > com.webobjects.eocontrol.EOCustomObject.propagateDeleteWithEditingCont > ext(EOCustomObject.java:688) > at > com.webobjects.eocontrol.EOClassDescription.propagateDeleteForObject > (EOClassDescription.java:523) > at > com.webobjects.eocontrol.EOCustomObject.propagateDeleteWithEditingCont > ext(EOCustomObject.java:688) > at > com.webobjects.eocontrol.EOEditingContext.propagateDeletesUsingTable > (EOEditingContext.java:2231) > at com.webobjects.eocontrol.EOEditingContext._processDeletedObjects > (EOEditingContext.java:2193) > at com.webobjects.eocontrol.EOEditingContext._processRecentChanges > (EOEditingContext.java:1744) > at com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges > (EOEditingContext.java:3257) > at com.webobjects.eocontrol.EOEditingContext.saveChanges > (EOEditingContext.java:3213) > ... > > The children/parent relationships between nodes are in fact flattened > relationships, which run via a many-to-many table. Did someone happen > to run into this problem before? > > Best, > J.L.Simon > _______________________________________________ > WebObjects-dev mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/webobjects-dev