What happens when NSManagedObjectContext
has both persistent store and parent context set and save is called? Will it push the data both to persistent store and the parent context one by one? Or would it do it concurrently? Or would core data simply throw a complaining exception?
API does not directly stop one from setting two "parents" for a given context.
This will happen:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Context already has a coordinator; cannot replace.'
This happens because when you set parentContext
, the persistentStoreCoordinator
is automatically set to the persistentStoreCoordinator
of the parent context.