NSFetchRequest ignores fetchBatchSize in nested NSManagedObjectContext setup
| Originator: | bill | ||
| Number: | rdar://21603124 | Date Originated: | 29-Jun-2015 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 8.3 |
| Classification: | Performance | Reproducible: | Always |
Summary: In certain nested MOCs configuration, NSFetchRequest fetchBatchSize is ignored. This seems to be the case when the main context does not have direct access to persistent store. Code example modified from "iPhoneCoreDataRecipes" is provided as example. When the problem happens, SQL log looks like what's found in "limit clause missing" Steps to Reproduce: Use attached sample data in folder - 76BFE3FF-2C24-4AAF-B18C-E229F9BA4DE7 Run the attached sample code for different MOCs setup starting at RecipesAppDelegate.m L128 Observe the SQL debug log generated For "single context" and "main context as parent context" cases, fetch request behaves as expected. For the other cases where the main context doesn't have direct access to the persistent store, fetchBatchSize is ignored Expected Results: fetchBatchSize should be honored. i.e we should see LIMIT clause added in the SQL. Actual Results: LIMIT clause is not found. Version: iOS 8.3 Notes: Configuration: iPhone 5s Attachments: 'Bug report sample.zip' was successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!