On Jun 21, 2009, at 19:02, Jerry Krinock wrote:

It turns out that I wasn't inserting any Bars at all into that moc. But when I did this:

 [foo1 setBar:bar] ;
 [foo2 setBar:bar] ;

the Foos and the bar were in different managed object contexts that had different stores -- Yikes -- I was setting cross-store relationships. Apparently, the Core Data runtime responds to this attempt cordially, by "doing what I mean". It copies attributes and inserts a new one into the same managed object context as the other object in the relation.

This sent me searching the documentation for something that talks about cross-context (not cross-store) relationships, but haven't yet found anything definitive. There's an implication that different contexts may contain different realizations of the same "store- object" (mediated by UID, under the presumption of the same persistent store), and half an implication that cross-context relationships might be resolved at save time (under the same presumption about the persistent store).

That suggests that if there are cross-context, cross-store relationships between objects which are each realized only in a single context/store, cross-context resolution might well realize the "missing" object realizations first, each in the correct (because only) store for its context, thus eliminating the cross-store references before they can be detected.

If that's so, I would call it a bug, not "doing what I mean". So, to summarize:

(1) What are the conditions (if any) for a cross-context relationship to be valid?

(2) What invalid cross-context relationships are failing to be detected by Core Data?

Seems to me both might be worth filing a bug report -- the first against the documentation, and the second (using what could be a very simple example you're now in a position to construct) against the functionality.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to