I have a problem with the core data object graph not properly persisting:

Managed Object A (Car) has a one-way, one-to-many relationship to several 
Managed Object B's. (Tires)

When I create the object graph, I use the standard generated relationship set 
mutator methods to setup the relationships:

[carMO addTireObject:tireMO]

After creating the full object graph, I have validated that everything is 
correct.  Reviewing the relationship sets show 4 tires in the set of the car 
relationship. 

Yet, when I save this to the persistent store and either reset the MOC or rerun 
the app and access the previously saved data, everything is there but many of 
the relationships noted above are missing.  *If I switch the type to a 2-way 
inverse relationship (many-to-many), it all works fine *  Without going into 
too much detail, establishing this with the inverse is causing a dramatic and 
not acceptable increase in the time to save and also the size of the store.  
(1M+ cars, 50 tires each for example).  

My question is not around the performance issue with the inverse.  I would like 
to understand why the one-way relationship is not sticking.  I don't need the 
inverse and the cost is too high.  I have tried making sure that all the tires 
are flushed to the persistent store and have permanent ID's first; no change in 
the above.  Also, as I mentioned, it is not 100% of the relationships that are 
missing.  I can not find a pattern and roughly 90% are not sticking.

Any insight into using a one-way one-to-many relationship?  

Thanks,
Greg

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to