Re: a HUGE Core Data bug
Re: a HUGE Core Data bug
- Subject: Re: a HUGE Core Data bug
- From: "Jim Thomason" <email@hidden>
- Date: Mon, 12 Mar 2007 07:38:12 -0500
I don't see what this debate is about. It's recommended to add in
inverses. You don't technically -have- to, since you can manage 'em
yourself. But if you don't want to manage it, set the inverse.
Moreover, you seem to have overlooked the details: the problem only
arise with SQL store, not with the 2 other stores... so the behavior
of Core Data, regarding graph coherency, is not consistent and
depends on the store type. This is what I call a major drawback:
performance by type of store are well commented, but the coherency is
not...
Wrong. I will now stand up and volunteer as someone that saw
inconsistencies in his Core Data store on the one relationship I had
that didn't have an inverse and I was using the ascii XML data store.
So there's your counter example - inconsistencies can arise regardless
of the store.
The important thing to remember is that, as I understand it, the
behavior when there is no inverse is undefined. The behavior is not
"doesn't work". It's that the outcome is undetermined. So sometimes
it'll work and produce the correct results, and sometimes it won't
work and won't produce the correct results. If you haven't seen
problems with other stores, maybe you're lucky. Or maybe you didn't
hit the right sequence of commands to display bad behavior that way.
Again, undetermined.
For my case, I also was able to "use" the app by correctly inserting
data in the proper sequence, and judicially quitting the app and
re-launching it. So I could hack around the lack of the inverse
relationship to get the proper behavior, but that doesn't mean it was
working.
If adding an inverse relationship is a compulsory for Core Data, then
i'll file a bug to make Xcode not only warn me when there is no
inverse, but generate a compiler error by default (and generate a
warning only if the developer set the right parameter...)
I can't recall off the top of my head which option it is to set in
XCode, but you can have the thing warn you every single time about the
inverse relationship, so at a minimum, it should be the only warning
that's always staring you in the face. In that case, fix it.
I don't see an issue here.
And please try my program both on Mac OS X 10.5 and 10.4, the
behavior is definitely not the same, so I think that Core Data
engineers have probably found a way to enhance relationships without
inverses integrity.
Apple's always enhancing code, fixing bugs, analyzing issues, adding
features, and so on. All software developers should be. I chalk this
up to that. If it does indeed work in 10.5, then my answer is "cool,
but I'll keep adding inverses since I support 10.4." I don't even see
the point of the complaint. The new version of the OS has some
whizbang feature that the current one doesn't? This is news? I'd
expect that to be the case!
Incidentally, when I was having my problems, I dug around a bit and
found a note about inverses being highly recommended, if not outright
required. So I shrugged my shoulders and added in the inverse.
Problems all went away.
-Jim....
_______________________________________________
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