Why are batch requests in Core Data executed against NSManangedObjectContext instances?

If batch requests don’t actually change the context they are executed against, why must they always be run in a specific context?

This adds to confusion about concurrency in Core Data because developers may expect tasks executed on a context to actually have some connection to that context.

You will find similar language across Apple Documentation on batch inserts, deletes, and updates:

NSBatchInsertRequest... accesses the store directly without interacting with the context, triggering any key value observation, or loading data into memory.

https://developer.apple.com/documentation/coredata/loading_and_displaying_a_large_data_feed

I wish I could edit the title! 😅

For indexing purposes, the correct word is:

NSManagedObjectContext


Why are batch requests in Core Data executed against NSManangedObjectContext instances?
 
 
Q