Re: weird EOF exception in propagateDeleteWithEditingContext
Re: weird EOF exception in propagateDeleteWithEditingContext
- Subject: Re: weird EOF exception in propagateDeleteWithEditingContext
- From: Chuck Hill <email@hidden>
- Date: Thu, 28 Aug 2003 10:30:02 -0700
At 01:47 PM 27/08/2003 -0500, Jonathan Rochkind wrote:
>Man, since I've improved my unhandled exception logging, and started
>considering all these unhandled exceptions problems that need to be solved,
>I run into all sorts of mysterious stuff.
>
I know the feeling. If you were on OSX you could make use of /dev/nul. Grin.
>This situation is complicated to even explain what's going on. But it
>involves an unflattened many-to-many relationship. In fact, I am seeing
>this exceptoin logged with two completely different sets of entities in
>such a relationship, from different parts of my code. Just for
>simplicity, let's call it Department and Employee, with a
>JoinDepartmentEmployee join table.
>
>I delete a Department. I save changes. Of course
>propagateDeleteForEditingContext is called on the Department. Which,
>because of the cascade rule on JoinDepartmentEmployee, deletes that join
>object. Which itself has a 'nullify' rule on it's destination,
>Employee. So, of course, EOF tries to call
>destinationEmployee.removeFromDeptJoinObjects( theDeletedJoinObject ).
>
>But this raises a NullPointerException. Apparently
>Employee.deptJoinObjects() is returning null, instead of an array
>containing that join object (or an empty array for that matter!).
>
A couple of possibilities come to mind:
1. The employee is actually a "dummy fault eo" due to some referential
integrity problem. This might happen if it has been deleted in another
instance after the relating object has been fetched into the one producing
the error. I *think* that is possible. And very nasty to deal with.
2. One of the related objects is in a different EC. I'd consider this less
likely, but I don't know how removeObjectFromBothSidesOfRelationshipWithKey
(ever wanted an e-mail client with code completion?) is implement or,
indeed, if propagateDeleteForEditingContext() uses that. It might do
somethink like destinationObjectForSourceGlobalIDAndRelationship() (yeah, I
just made that up) which fails when it can not find the object in the EC.
>Note
>that I still have the old 5.0-generated code for removeFromRelationship,
>which is why the stack trace points me to a null pointer exception that I
>know is from deptJoinObjects() returning null.
>
That sounds more like a dummy fault object, no?
Chuck
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.