Subject Re: Can't delete closed database
Author Adam
Hello Richard,

> 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.

> 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.

Adam