Den 2017-06-05 kl. 12:34, skrev Richard Hipp:
On 6/5/17, Daniel Polski <dan...@agelektronik.se> wrote:

Den 2017-06-02 kl. 16:07, skrev Richard Hipp:
and I thought that SQLITE_CHECKPOINT_TRUNCATE would force the checkpoint
to completion.
Do you have a busy callback handler registered
(https://sqlite.org/c3ref/busy_handler.html)
No busy callback is registered, but we do set the:
sqlite3_busy_timeout(db, 0)

SQLITE_CHECKPOINT_TRUNCATE waits until either it is able to run the
checkpoint to completion and truncate the WAL file, or until the
timeout expires.  Since you have the timeout turned off, the
SQLITE_CHECKPOINT_TRUNCATE does not wait at all, and simply fails if a
reader is preventing the timeout from running to completion.



Aha.

"In applications with many concurrent readers, one might also consider running manual checkpoints with the SQLITE_CHECKPOINT_RESTART or SQLITE_CHECKPOINT_TRUNCATE option which will ensure that the checkpoint runs to completion before returning."

How do I make the checkpointing work like the above documentation describes? (I thought my call would block until it finished since it was described as "will ensure that the checkpoint runs to completion").

So in my case, what's happening is:
- trying to checkpoint
- checkpoint finds there are active readers
- block access for new readers, wait 0 time for current active readers to finish
- times up, readers still active, return checkpoint failed?
..Correct?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to