UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
- Subject: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
- From: "Doug Knowles" <email@hidden>
- Date: Mon, 11 Feb 2008 20:25:37 -0500
It turns out that deletion of the object in question in any context
(including the UI action that's been in place for many months).
To recap: I am deleting an NSManagedObject (called an "item") with a to-many
relationship to a "link" entity, which has a to-one inverse relationship.
The delete rule on the to-many relationship is "Cascade"; the delete rule
on the inverse relationship is "Nullify". After deletion (and after
processPendingChanges), the link entity is not deleted, and other entities
retain a relationship with it (even though those relationships should have
been nullified by the deletion of the link).
I haven't touched the model for weeks, maybe months, and this operation was
working well after the last time I did change it. I'm starting to suspect a
corruption in the model, but there doesn't seem to be an easy way to check
it.
Doug K;
On Feb 11, 2008 4:27 PM, Doug Knowles <email@hidden> wrote:
> Well, per the tech note, I do call processPendingChanges before I do the
> manual validation (which catches undeleted now-invalid objects). And my
> understanding is that processPendingChanges is automatically called on a
> Save, which is where I first encountered the invalid records.
> The release note implies that Core Data is doing some work (like
> propagating deletions) at the top of the event loop; could it be that the
> processing of incoming AppleEvents is short-circuiting whatever Core Data
> normally does?
>
> On Feb 11, 2008 2:19 PM, Adam Swift <email@hidden> wrote:
>
>
> > Have you tried manually calling "processPendingChanges" after the
> > delete? Cascade deletes are not processed immediately:
> >
> >
> > http://developer.apple.com/releasenotes/Cocoa/CoreDataReleaseNotes/index.html
> >
> >
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden