Subject Re: [firebird-support] Re: Can't delete closed database
Author Richard Wesley
On 24 Sep 2007, at 17:31, Adam wrote:

>> Not sure how to shut down the database with embedded. Also, this is
>> not really something I can do in a general purpose tool - just
>> because one task is done with its database does not mean that
>> another task is not still doing something.
>
> Is a normal database shutdown not possible through the Services API? I
> recall Dmitry stating that the new shutdown modes are not available
> through the API (in response to Martijn's question about a week ago).
> I have never needed to do so because it is safe to copy an 'embedded'
> database once the application with the embedded server is terminated.
>
> I am also a bit confused about your concern. If you can not make the
> assumption that no other task is doing something, then what on earth
> are you doing trying to drop the database on them? I would think that
> putting the database into a shutdown state is less of an issue for
> them than dropping the database.

I can shut delete the database, but some other part of the
application may have a DIFFERENT database open and shutting the
entire embedded server down would be rude.

(We have an unusual use case for the embedded server. Most folks
just use it to connect to a single database for a particular task.
We allow the user to create arbitrary numbers of local data extract
from arbitrary servers, so any number of databases could be active
when the user is deleting an unwanted database.)

>> So how do I make sure that nothing has the file open?
>
> Google Process Explorer by SysInternals/Microsoft. It has an option to
> Find Handle or DLL. Type in your database name and hit search, and it
> will highlight the processes that are locking it.

That is a good idea, although I suspect I will just find that
fbembedd.dll has it open...

________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html