> However, I am surprised that it does not at least possess a
> list of all open handles to a given database.  If I had that, then I could
> close all DB connections either before the delete or after.  Are you sure
> that such a list does not exist?

If SQLite was able to obtain such list (not in the same process but
among several different processes, remember?) that would be a serious
security breach in the kernel. Let alone the possibility of closing
file handles in other processes.

> Wouldn't it use it for mechanisms like
> 'unlock notify' and 'busy handler', etc?

It's implemented using simple polling technique: try to lock; if it's
unsuccessful sleep for some small time; try to lock again and repeat
that until lock is successful or the total waiting time is too long.


Pavel

On Fri, Nov 12, 2010 at 11:44 AM, Dennis Suehr <den...@suehr.me.uk> wrote:
> Simon,
>
> Many thanks for your prompt and thorough response.
>
> Just a couple of follow-up questions if I may:
>
> Firstly, a bit more background information.  The system will be running on
> Linux (kernel > 2.6.0) and all accesses to the database will be via local
> disk (ext3 or similar).
>
> 1) I appreciate your explanation about any any open connections to the file
> still being able to write to it until they close it.  I suppose that 'fuser'
> could be used to send a SIGTERM or similar to the processes holding open
> file handles.  I will have to give some additional thought to how I go about
> this 'delete' operation.
>
> 2) Regarding, SQLite and open handles to a database, that is fair enough
> that it does not have a mechanism send alerts to all processes connected to
> a given DB.  However, I am surprised that it does not at least possess a
> list of all open handles to a given database.  If I had that, then I could
> close all DB connections either before the delete or after.  Are you sure
> that such a list does not exist?  Wouldn't it use it for mechanisms like
> 'unlock notify' and 'busy handler', etc?
>
> 3) Finally, am I correct in thinking that if I used 'pragma locking
> exclusive' that I can lock the entire database even after closing my
> connection?
>
> Cheers,
>
> Dennis
> _______________________________________________
> 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

Reply via email to