Hello,

Apologies if an answer to my query exists elsewhere.  I have been searching
for a fair while without success.

I am building an SQLite interface as a C shared library and consequently
will have no knowledge or control of concurrent connections to any databases
which are created by it.

I need to implement a function which will be able to delete a previously
created database.  I plan to do this by obtaining an exclusive lock to the
DB, then closing my connection (which as I understand will still keep the DB
locked) and then removing the DB file (and related SQLite temp files) from
the underlying file system.

I have a couple of concerns regarding this operation, which are as follows:

1) Firstly, I can not seem to ascertain what would happen to another process
which held an open database handle to the now deleted DB if it tried to
perform a subsequent operation on it.  If some appropriate error code is
returned upon which I can act, then great.  However, it goes without saying
that a seg fault would not be an appropriate outcome

2) Ideally, I would like to be able to force close any open connections
before deleting the database file and if that's not possible then at least
being able to clean up any SQLite related memory resources from those other
connection afterwards.  However, I can not even find any existing SQLite
mechanism which would provide me with a list of open connection handles to a
given DB.

Any help in either of these regards will be much appreciated.  Thank you in
advance,

Regards,

Dennis
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to