On 7 Nov 2014, at 10:33am, Yves Crespin <[email protected]> wrote:

> We use sqlite3_open_v2() with
> SQLITE_OPEN_READWRITE|SQLITE_OPEN_FULLMUTEX flags and all the
> transactions are exclusive.
> 
> 
> So, if we add a SQLITE_BUSY handle, can we use the sqlite3 .backup
> when the application is running?
> 
> Is it safe or is there a risk to corrumpt the database or do we need
> to change some settings ?

The Backup API can not corrupt the data it is backing up.  The Backup API can 
not produce corrupt backups.  These are true no matter what your flags are, 
unless you are intentionally using bad flags for your setup.

However, the backup API works this way:

<https://www.sqlite.org/backup.html>

"If another thread or process writes to the source database while this function 
is sleeping, then SQLite detects this and usually restarts the backup process "

In other words, if you have a process which occasionally writes to the database 
faster (using a different connection) than an entire backup can be taken, the 
backup is restarted after each write.  Under those circumstances your backup 
will probably complete after normal database writing does down, perhaps after 
your users go home for the evening.

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to