On Sun, 2005-05-01 at 00:28 +0800, Damian Slee wrote:
> i want to make a copy of a sqlite3 database file while it is open.  is
> there anyway that i can tell programatically that any caches/journals
> are flushed out? or is there any way to get and exclusive lock i
> guess, before making a backup copy?
>  

1. Execute the SQL statement "BEGIN EXCLUSIVE".
2. Make your backup copy of the database file.
3. Execute the SQL statement "COMMIT".

The BEGIN EXCLUSIVE statement makes sure that the 
database file is locked and will not be changed while
your are copying it.  The COMMIT statement release
the lock after you have finished making the copy.
-- 
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to