Reputation: 479
Our app has a process where we build a sqlite database and upload it to Amazon S3. When the app starts on a users phone it checks the version # of the database and if a newer one exists it downloads and replaces the sqlite database currently installed on the phone.
Since IOS 7 we have noticed that a lot of phones are getting a corrupted database error.
My instinct is telling me that it might have something to do with the default journaling mode for ios 7 and WAL journaling now being the default but have seen the same issue happen on IOS 6 when we generate the file using IOS 7.
Has anyone experienced this issue?
Upvotes: 2
Views: 660
Reputation: 5935
Two things I can think of: 1) There are some external files that are hanging around from the original DB that confuse SQLite. 2) When your app "starts" could your DB still be open (returning from background?). If you're trying to replace an open DB with a new one, the file system may be rejecting your delete of an open file, then you try to write the new one on top, etc...
Otherwise, you could download the new DB separately, open it's contents and update the existing one from the contents -- a lot more work.
Upvotes: 1