Re: [sqlite] DB file locked when no other process using it - Found word(s) list error in the Text body

2010-09-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/15/2010 01:43 AM, Nick Shaw wrote:
> 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).

The cause of this is almost always tag alongs.  They register with the
kernel and get notified when a file is about to be closed, so they promptly
open it and then do whatever with it.

Number one whatever is virus scanners, but the culprits can also include
backup tools, source control tools and various Explorer extensions that like
to display status/icons for files.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyQjegACgkQmOOfHg372QSdzwCg1ol6P7DZfCv0tXexuyVYaRI6
EOkAoKmVDOl8oVbTwUoDsVKefXEUPn8I
=zXNt
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] DB file locked when no other process using it - Found word(s) list error in the Text body

2010-09-15 Thread Nick Shaw
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: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] 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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users