Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Why does it save both local context and default context? #143

Closed
fossli opened this Issue Feb 17, 2012 · 3 comments

Comments

Projects
None yet
3 participants

fossli commented Feb 17, 2012

When we use
+[MRCoreDataAction saveDataInBackgroundWithBlock: completion]
it seems we are first saving the local context then the default context. Is this the way it should be? Aren't we trying to avoid just that by using a local context? Please explain.

2012-02-16 15:34:43.942 myapp[47113:1490b] -NSManagedObjectContext(MagicalRecord) MR_saveWithErrorHandler: Saving Context
2012-02-16 15:34:43.947 myapp[47113:1490b] -NSManagedObjectContext(MagicalRecord) MR_saveWithErrorHandler: Saving  *** Default *** Context

@ghost

ghost commented Feb 17, 2012

This is how the WWDC core data examples work with the parent/child contexts. If you're talking about the thread isolation mode, this should not be happening. It should save the background context, and merge the changes in to the default context without saving.

fossli commented Feb 17, 2012

Okay. As long as performance is optimal I won't argue :)
Thanks a lot.

@ghost

ghost commented Feb 17, 2012

The goal is to make the 90% case the easiest. That said, if you find performance bottleneck, please let me know, or better yet, submit a pull request with a fix :)

Thanks

Saul Mora
Founding Panda
saul@magicalpanda.com

On Feb 17, 2012, at 8:14 AM, fossli wrote:

Okay. As long as performance is optimal I won't argue :)
Thanks a lot.


Reply to this email directly or view it on GitHub:
#143 (comment)

@tonyarnold tonyarnold closed this Dec 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment