Currently I am using a fixed number of NSManagedObjectContext objects: 1 for writing, 2 for reading.
All of them are background contexts created with newBackgroundContext() method and merge policy is set to NSMergeByPropertyObjectTrumpMergePolicy. Based on this setup, it seems like CoreData should always be able to resolve unique constraints when data is being inserted. I wonder, if this failure could be avoided by using a custom merge policy? It feels like based on my setup CoreData implies that such unique constraints issue should not happen and that is why it leads to a crash.
Post
Replies
Boosts
Views
Activity
Thank you for quick response. I'll review constraints. The model has id property constraints for many entities so it has to be that. Unfortunately I haven't managed to reproduce this myself and don't have the detailed error log available.