On Thu, Mar 14, 2013 at 4:28 PM, J Trahair
<[email protected]> wrote:
> There will be times when the program running the SQLite database will copy 
> the database file MySQLiteDatabase.db to another folder, where the copy will 
> be zipped (compressed). What happens if another user (User B) is writing a 
> record to the db at the same moment that User A's program is copying it to 
> the other folder. Glitches, corruption...or perfect integrity?

If the program cannot ensure that there are no open connections to the
database file for the duration of the file copy then you should use
the SQLite backup api to copy the db file instead of a plain file
copy. The result is guaranteed to be consistent. For instance if an
update is made to the db during the backup process then the process
will be restarted transparently.

http://www.sqlite.org/backup.html

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

Reply via email to