On 03/06/2012 06:45 PM, Max Vlasov wrote:
On Tue, Mar 6, 2012 at 2:37 PM, Dan Kennedy<danielk1...@gmail.com>  wrote:

On 03/06/2012 02:41 PM, Max Vlasov wrote:

.... But for correct work this vfs should rely on the
fact that file change counter will stay the same until the final write to
the first sector.



Do you just want some hook called when a transaction is committed
and the file is completely updated? That might be the xSync() on
the db file.


It's an interesting suggestion, thanks. I just thought that using xSync I
even can only implement my own db change counter. In any case the question
is will it be called for rollback?

It can. If a large transaction (one that won't fit in the pager
cache) begins modifying the database before it is committed, then
is rolled back, the database file will be synced after the rollback
is finished. So if you stored a snapshot at that point it would be
a duplicate of the previous snapshot.

If this is a big deal, you probably could filter these states out
by keeping an eye on the change-counter.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to