ERXEC vs EOEditingContext
ERXEC vs EOEditingContext
- Subject: ERXEC vs EOEditingContext
- From: Johnny Miller <email@hidden>
- Date: Fri, 13 Mar 2009 10:26:21 -1000
Hi,
I was writing some tests to verify my eomodel and I came into a
situation where the test would fail if I used
ERXEC.newEOEditingContext() vs new EOEditingContext() for the editing
context.
Basically, I have many entities that are chained together by one to
many relationships. In the test I check if I delete one of the lower
entities that the the entities connected to it's to many relationship
are deleted by the cascade rule.
That appears to work but during the tearDown method while I delete the
top entity (which should delete all the entities in the chain) with
ERXEC I get the following error:
java.lang.IllegalArgumentException: Array is empty
at com.webobjects.foundation.NSArray.objectAtIndex(NSArray.java:392)
at
com
.webobjects
.eocontrol
._EOCheapCopyMutableArray.objectAtIndex(_EOCheapCopyMutableArray.java:
110)
at
com
.webobjects
.eocontrol
.EOClassDescription.propagateDeleteForObject(EOClassDescription.java:
502)
at
com
.webobjects
.eocontrol
.EOCustomObject.propagateDeleteWithEditingContext(EOCustomObject.java:
693)
at
com
.webobjects
.eocontrol
.EOClassDescription.propagateDeleteForObject(EOClassDescription.java:
509)
at
com
.webobjects
.eocontrol
.EOCustomObject.propagateDeleteWithEditingContext(EOCustomObject.java:
693)
at
com
.webobjects
.eocontrol
.EOClassDescription.propagateDeleteForObject(EOClassDescription.java:
509)
at
com
.webobjects
.eocontrol
.EOCustomObject.propagateDeleteWithEditingContext(EOCustomObject.java:
693)
at
com
.webobjects
.eocontrol
.EOEditingContext.propagateDeletesUsingTable(EOEditingContext.java:2248)
at
com
.webobjects
.eocontrol
.EOEditingContext._processDeletedObjects(EOEditingContext.java:2210)
at
com
.webobjects
.eocontrol
.EOEditingContext._processRecentChanges(EOEditingContext.java:1770)
at
com
.webobjects
.eocontrol.EOEditingContext.processRecentChanges(EOEditingContext.java:
1969)
at er.extensions.eof.ERXEC.processRecentChanges(ERXEC.java:659)
at er.extensions.eof.ERXEnterpriseObject
$Observer.editingContextWillSaveChanges(ERXEnterpriseObject.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:
122)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
at
com
.webobjects
.foundation
.NSNotificationCenter.postNotification(NSNotificationCenter.java:546)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:901)
at
com
.kahalawai.unittests.enterprise.VersionTest.tearDown(VersionTest.java:
144)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org
.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:
76)
at
org
.eclipse
.jdt
.internal
.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at
org
.eclipse
.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org
.eclipse
.jdt
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org
.eclipse
.jdt
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org
.eclipse
.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org
.eclipse
.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)
Is there something in my model that could have caused this?
Best,
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden