Hullo,

I have a package manager that consists of a sqlite database combined 
with a filesystem journal that is created during system updates. The 
journal contains enough information to clean up the filesystem if an 
update is interrupted by e.g. a power failure. Naturally, these two 
journals need to be synchronized so that the window between the database 
committing (thus recording that the package has been installed 
successfully) and the FS journal committing (thus preventing the update 
from being undone) is as small as possible.

I see that a sqlite commit is split into two distinct phases, the first 
being acquiring an exclusive lock and flushing dirty pages and the 
second being the unlinking of the journal which constitutes the actual 
commit. I would like to invoke the first phase manually since it can 
take a non-trivial amount of time, then commit the filesystem journal 
and finish the sqlite commit. This would minimize the window during 
which an interruption could cause inconsistencies.

Is there a sanctioned way to cause sqlite to perform the first phase 
commit, or to otherwise make the actual commit as fast as possible? I 
have control over the language bindings, so C functions are fine as long 
as they are public API. Shipping a modified sqlite is also possible 
although I would prefer not to.

Thanks,
-- m. tharp
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to