• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NON-mysterious EOF problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NON-mysterious EOF problem


  • Subject: NON-mysterious EOF problem
  • From: Jonathan Rochkind <email@hidden>
  • Date: Mon, 26 Jan 2004 18:06:52 -0600

Okay, I have an EOF problem that I actually understand! Hooray! But I'm not sure the right way to solve it.

Imagine a many-to-many relationship. It's not flattened, it's exposed. Let's call it Person, Unit, and the 'join' entity PersonUnitJoin. All the delete rules are set appropriately.

Now let's imagine a PersonUnitJoin object/row exists, which has a foriegn unitID key, theoretically pointing to a Unit, except----that Unit doesn't exist. It's bad data, it's a foreign key that does not actually exist. Of course this is bad, and we strive to avoid bad data as much as possible, but sometimes for mysterious reasons we can't figure out it's there anyway, and we want our code to tolerate it as much as possible.

So, now we're deleting the Person. One of that person's PersonUnitJoin's is one of these bad data, with an invalid unitID. When EOF does the propagateDeleteWithEditingContext and follows all the join rules---when it gets to this bad PersonUnitJoin and triggers it's fault to Unit, you wind up with one fo those weird 'ghost'/'missing' EOs, which has all of it's values set to null. When the propagate delete code tries to operate on this weird ghost Unit---you wind up with an exception.

What can I do to properly and succesfully delete all this stuff, including the 'bad data' PersonUnitJoin, despite the fact of the bad data. Sorry, maybe I didn't explain this very well, but hopefully the EOF experienced understand what I'm talking about.

I can think of several possible solutions, but most of them seem to lead to more likely problems. I'm wondering if anyone has any advice.

The actual stack trace that occurs in such a situation is pasted below. (CLACustomRecord is my own custom subclass that some of my EOs have, it extends EOGenericRecord, and it doesn't do anything unusual in propagateDelete, I don't think).


EOCustomObject.java 987 excludeObjectFromPropertyWithKey Mail.java 169 removeFromPersonMailRecords Method.java NA invoke NSSelector.java 120 _safeInvokeMethod EOCustomObject.java 1011 removeObjectFromPropertyWithKey EOClassDescription.java 478 propagateDeleteForObject EOCustomObject.java 688 propagateDeleteWithEditingContext CLACustomRecord.java 246 propagateDeleteWithEditingContext EOClassDescription.java 523 propagateDeleteForObject EOCustomObject.java 688 propagateDeleteWithEditingContext CLACustomRecord.java 246 propagateDeleteWithEditingContext Person.java 1018 propagateDeleteWithEditingContext EOEditingContext.java 2137 propagateDeletesUsingTable EOEditingContext.java 2099 _processDeletedObjects EOEditingContext.java 1653 _processRecentChanges EOEditingContext.java 3159 _prepareForPushChanges EOEditingContext.java 3115 saveChanges _______________________________________________ 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.

  • Follow-Ups:
    • Re: NON-mysterious EOF problem
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: EO & WebServices
  • Next by Date: Re: how do I "recompile with deprecation" ?
  • Previous by thread: encodeWithCoder for objects in Dictionary
  • Next by thread: Re: NON-mysterious EOF problem
  • Index(es):
    • Date
    • Thread