-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ReadMe.md to help prevent crashes with large databases. #301
Comments
This seems to only happen on migrations, not "large databases". Just want to clear up the cause since Core Data doesn't load anything other than the stack objects when it launches and connects to a persistence store. That is, only the stack is created, which points to the data on disk. All that data stays there until you fetch it. Migrations on the other hand, need to load (transfer) all the data from one persistent store to the new, migrated version. All that data loads into memory and could take a while. The proper solution would be to update the MagicalRecord setup methods that have migrations enabled, and perform those in a background thread so that applicationDidFinishLanching can complete. Then a notification or block callback can then finish loading the rest of the app... On Nov 7, 2012, at 8:00 AM, JHumphreyJr notifications@github.com wrote:
|
Thanks for the response. When I was referring to the setup of large databases I was referring to any logic a user may decide to run immediately after initial setup to load large amounts of data. While that is outside of the API, I believe some sort of mentioning of special handling for large databases should be included in the ReadMe. I am also not sure if a background migration would work well without mechanisms to alert the application when the database is ready. To fix the problem in my application I postponed the Core Data migration until the next run loop by calling |
Alerting users to migrations are probably not common or ideal. On Nov 7, 2012, at 11:18 AM, JHumphreyJr notifications@github.com wrote:
|
By user I meant developer and by alert I meant If you look at what I needed to do you can see that the developer will have to make sure to not make any Core Data calls or create any classes that make Core Data calls, especially since it is easy to grab the default context using |
Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues. If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks! |
@tonyarnold this issue still occurs, for instance migrating a large database (50MB) triggers a watchdog crash. This is due to the fact that |
I recommend updating the ReadMe.md to include waiting after the
applicationDidFinishLaunching:(UIApplication *) withOptions:(NSDictionary *)
method to setup/migrate large databases for iOS devices. The reason is because large databases, especially on slower iPads (iPad 1 and early iPad 2s), may take a long time to setup or migrate. If it takes too long Apple will kill the application with a "[appname] failed to launch in time" before the setup/migration finishes. Here are some related Stack Overflow posts.http://stackoverflow.com/questions/7641742/ios-core-data-migration-time-out
http://stackoverflow.com/questions/2860310/iphone-app-launch-times-and-core-data-migration
http://stackoverflow.com/questions/2160848/core-data-causing-app-to-crash-while-migrating
The text was updated successfully, but these errors were encountered: