Jean-Christophe, Thanks for your response.
The backup feature looks promising. If we can figure out how to access it within Django then it looks like it is what we need. Kevin Yoo Certification Lead Wurldtech Security Technologies 1680-401 West Georgia St. Vancouver, BC, V6B 5A1 Phone: (604) 669 6674 ext. 232 Fax: (604) 669 2902 "ARE YOU ACHILLES CERTIFIED?" This message is intended only for the named recipients. This message may contain information that is privileged, confidential or exempt from disclosure under applicable law. Any dissemination or copying of this message by anyone other than a named recipient is strictly prohibited. If you are not a named recipient or an employee or agent responsible for delivering this message to a named recipient, please notify us immediately by telephone at 604-669-6674, and permanently destroy this message and any copies you may have. Email may not be secure unless properly encrypted. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jean-Christophe Deschamps Sent: June 15, 2011 2:38 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Is there a difference between DELETE and UPDATE/INSERT in terms of syncing to disk? Kevin, >I have confirmed that the DELETE does indeed delete the record, but >only after Django's delete callback has completed. If what you say is >true, that DELETEs are proceed immediately, then the only other >explanation is that Django, upon sending of the post_delete signal, >has not actually run the SQL DELETE command. Note, however, that >Django provides a means of checking which SQL commands it has run, and >when the callback function is entered, Django claims that the DELETE >statement has been executed. With out-of-the-box build and unless specific pragmas are used, the physical writes are guaranted to have taken place when the write transaction (or statement in auto-commit mode) is completed successfully. This is of course modulo the OS and hardware layers not lying to SQLite. I don't know Django and what it does behind the scene. It the write --say a delete-- successfully completes but you still can see that row afterwards using another connection, that probably means that Django and/or your OS and/or your hardware is/are cheating. >Perhaps it would be easier to get assistance if I ask my question in a >different way. What I am really trying to do is database mirroring: I >have my db file on disk, and I have a backup on a USB drive, and I >want the contents of both to be the same at all times. I am currently >trying to do this by using Django's db hooks; on every modification I >do an OS copy of the file to the USB drive. Does sqlite provide >support for doing this? SQLite has a backup feature but it isn't exactly what you want. Lookup the backup API in the documentation. It's an asynchronous process but if your DB isn't huge, if you only seldom update it (i.e. not 50 updates/s) and run the backup frequently enough, it's just fine. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

