On 2/21/18, Deon Brewis <de...@outlook.com> wrote:
>
> a) Is it expected that an app crash / force terminate in the middle of a
> SQLITE3 checkpoint like this can cause corruption?

No.  See, for example, https://www.sqlite.org/atomiccommit.html and
https://www.sqlite.org/wal.html and .  If the filesystem is behaving
properly, and assuming no other application tries to "clean up" after
a app crash, then the database will be automatically restored to a
consistent state the next time it is opened.  This is extensively
tested.

Usually issues like this come back to either filesystem bugs or the
watchdog, or some other component, going in an deleting the -wal file
in an effort to be helpful and "clean up" after the application crash,
and thereby deleting information that SQLite needs to recover,
resulting in a corrupt database.

Other ways in which the database file can go corrupt:
https://www.sqlite.org/howtocorrupt.html

>
> b) Is there a way I can do a close without triggering a checkpoint? (In
> order to speed up close, so that it doesn't trigger a watchdog).
>

Set the SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option.
https://www.sqlite.org/c3ref/c_dbconfig_enable_fkey.html

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to