Richard,

Thank you for your response.

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. 

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? 

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
On Behalf Of Richard Hipp
Sent: June 15, 2011 10:49 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Is there a difference between DELETE and UPDATE/INSERT in 
terms of syncing to disk?

On Wed, Jun 15, 2011 at 1:39 PM, Sam Roberts <[email protected]> wrote:

>
> It would appear that sqlite3 does not immediately write DELETEs to
> disk. I have confirmed this behavior by pausing my Django app
> immediately upon entrance into my database hook callback, running
> sqlite in another process and examining the .db file on disk - the
> deleted record is still present.
>

No.  SQLite processes DELETEs as soon as they are entered, just like INSERTs
and UPDATEs.  I think you have an application bug.  Perhaps the WHERE clause
of the delete is not selecting any rows.  Or perhaps you are rolling back
the delete transaction without realizing. it.

-- 
D. Richard Hipp
[email protected]
_______________________________________________
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

Reply via email to