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
FMDB crashes in iOS7 #187
Comments
If you can reproduce it as described here: I'll take a look at it. Otherwise there's nothing to go on. |
Just curious here, as we're doing our own work with FMDB and want to ensure we have this case covered. Is this not the watchdog stating: "Hey, you went into the background and while you did spin up a background task to handle it, you took longer than the 10 minutes the system will let you run in the background. Headshot." Curious to know if anyone else has handled doing background handlers in conjunction with FMDB and how they write the "will be killed" block that is passed in (i.e., does one rollback the tx on the database and get out?). |
@avalanched Just to clarify, what sort of background operation is this? Are you using @scottcc I don't believe you need to do anything, as if the app is killed before the changes are committed, the database should be preserved fine. If you have series of updates that must be committed together, just make sure to wrap them in a transaction, and you should be good. |
@robertmryan Thanks - I was wondering what kind of ExpirationHandler I should set, given that I know I will be wrapping much (if not all) FMDB write functions in their own |
@scottcc I see the appeal of that idea, but I'm unclear as to how you could do a rollback of the transaction that is presumably still underway on a different thread. I might be inclined to set a
And then my
Perhaps others have better suggestions, but that's what I'd be inclined to try. Doing a little testing on the device (and don't do this with the debugger, as that alters the behavior), it appears that you have a few seconds after the expiration handler being called and where the app is killed if you fail to call |
Thanks @robertmryan - very helpful. Last question - do you guys recommend altering the shm/wal mode at all? We're thinking we'd probably use read only for access by the app. When updates come in, we are considering taking a copy, performing writes on that, and swapping it back. Not sure whether |
@scottcc I don't personally see any need for any of that, as I think the above achieves what you need. But perhaps others have opinions on this topic. Perhaps this would be a good question to post on a forum like Stack Overflow. |
I couldn't reproduce this issue but apple did during the review process.
And my app got rejected.
I have no clue why this happened
The text was updated successfully, but these errors were encountered: