My understanding is that mobile apps are not 100% predictable since
they may be randomly suspended or terminated, at any point of time.
The operating system should give a signal before suspending or
terminating but I would not trust it. Goes for Android, iOS, Windows
Mobile, and others.

To be extra safe I would use custom SQLite3 build with
-DSQLITE_DEFAULT_SYNCHRONOUS=3 build setting as documented in the
following places:
* https://www.sqlite.org/compile.html#extra_durable
* https://www.sqlite.org/compile.html#default_synchronous

Here is some recommended reading:
* https://www.sqlite.org/howtocorrupt.html
* 
http://sqlite.1065341.n5.nabble.com/Is-WAL-mode-more-robust-against-corruption-td99624.html
* 
http://sqlite.1065341.n5.nabble.com/Integrity-Check-Failure-Handling-td70289.html
* http://blog.niklasottosson.com/?p=852
* 
http://www.froebe.net/blog/2015/05/27/error-sqlite-database-is-malformed-solved/

Chris

https://www.linkedin.com/in/chrisbrody/

On Tue, Jun 12, 2018 at 6:21 PM skywind mailing lists
<mailingli...@skywind.eu> wrote:
>
> Hi,
>
> when I load my database into sqlite3 and run an integrity check I only get 
> the error message: Error: database disk image is malformed
>
> I do not get any further information. What causes this simple error message? 
> I expected to get some more information what is actually the reason why 
> SQLite3 thinks that it is malformed. Interestingly I can do a dump to a SQL 
> file for the (whole?) database.
>
> I would really like to find out the root cause of this issue because I 
> experience a corrupt database once a while on iOS. This only happens when the 
> app is terminated while running when the iDevice switches off due to low 
> battery issues.
>
> Best regards,
> Hartwig
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to