I've seen this kind of issue before - after closing the sqlite3
database, I can't delete the file (I would want to do this if I opened
an sqlite3 database and found it to be corrupt).  As sqlite's connection
handle has closed, I assume sqlite should no longer have any handles
open to the database; however Windows (which I'm running under) may well
still have open handles to the file waiting to flush cached changes to
disk.  The way I resolve this is to try deleting the file over and over
until either it succeeds, or it has still failed to delete after a set
time (say a few seconds).

Under Windows, you can see if any processes have a handle open to the
file through SysInternals' Process Explorer (go to Find->Find Handle or
Dll... and enter the sqlite file name - it'll highlight the first
process it finds with an open handle to that file).  You can then force
close the handle.  I'm not sure how to do this programmatically though,
or how to find/release locks on other operating systems.

Nick.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Andrew Wood
Sent: 14 September 2010 14:46
To: General Discussion of SQLite Database
Subject: [sqlite] DB file locked when no other process using it - Found
word(s) list error in the Text body

Im getting an error saying the database is locked even though no other
process is accessing the file. I think it was probably caused by a
process crashing part way through. Is there a way to force release the
lock?

Andrew

_______________________________________________
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