Subject Re: [firebird-support] File in use
Author Helen Borrie
At 12:27 AM 12/02/2005 +0000, you wrote:



>I'm trying to create a database then a table then insert a few rows
>into the new table.
>
>All of that works, but if I try to delete the database file
>afterwards, the file is in use by another process, how should I
>effectively close out all activity so that the file can be deleted?
>
>Here is my process:
>
>Create database
>Create connection
>Create transaction
>Create command
>Run SQL
>Commit transaction
>Close connection
>Dispose transaction
>Dispose command
>Dispose connection

Firebird database isn't a series of file-driven objects, it's one logical
file that is the campus of the server. The API doesn't physically touch
the database file at all - it acts as a bearer of requests. Applications
issue SQL commands to request the server to do things for you.

The proper way to delete a database is to connect to it and then issue a
DROP DATABASE command. You have to be SYSDBA or the database owner for
this to succeed. Then, the server will do the necessary filesystem
operations to delete the file.

If you must, you can filesystem-delete the database once the server has
been shut down and the client library is no longer loaded in server memory.

./heLen