Re: a HUGE Core Data bug
Re: a HUGE Core Data bug
- Subject: Re: a HUGE Core Data bug
- From: mmalc crawford <email@hidden>
- Date: Sat, 10 Mar 2007 05:08:55 -0800
On Mar 9, 2007, at 7:31 AM, Aurélien Hugelé wrote:
I just want to stress Core Data users, since i've discovered what I
think is a huge bug, that I reported to apple.
Basically, save an object graph to a SQL store, reload it from disk,
the object graph is not restored correctly, some relationships are
missing.
You can download a very simple project that demonstrate the bug at http://developer.gumitech.com/CoreDataDramaticalBug.zip
A Readme is included that explains the details.
I'm quite surprised that nobody here has encountered this bug, but
honestly I can't trust Core Data anymore, and I fear a customer
complain about data loss.
The documentation makes clear that not modeling a relationship in both
directions is strongly discouraged -- you really have to know what
you're doing in order to avoid significant problems.
The issue described in this "bug" will manifest on *any* version of
Mac OS X. It is an incidence of the general issue that to-many
relationships without inverses cannot be used this way.
The model has a ø->> relationship. This means that each object can
have multiple objects in its to-many. It does *not* mean that the
same object can be the destination in multiple different to-many
relationships.
If the project is changed such that object C is not put into both A
and B's relationships (i.e. just leave B with nothing) then it works
correctly. A has 1 object, C and C has 2 objects -- A and B.
So, to summarise, this is *not* a bug in Core Data, huge or
otherwise. It is a case of developer error. This sort of problem can
be avoided by following the guidelines in the documentation.
mmalc
(With thanks to BT.)_______________________________________________
Cocoa-dev mailing list (email@hidden)
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