Subject Re: How can I check using C# if firebird is running?
Author Adam
--- In, "clemenslinders"
<clemenslinders@...> wrote:
> LS,
> I noticed a few times that that the firebird service may be down.

Why would it be down? Is it crashing or do you have some hardware or
network issue?

> My
> application will than ofcourse crash.

Your connection libraries will probably throw an exception, and if you
do not handle that exception, then yes it will crash. Your application
does not have to crash though, it could do a friendly notification to
the user that the database is down of whatever the exception says.

> Ofcourse using VS 2005 C# I can use a TRY CATCH and if the database
> files exists than it remains the obvious that firebird must be down.
> But some kind of Firebird check is more elegant and possibly there is
> a way to start up the firebird service.

Why do a file exists check? My users don't even get file system access
to the database, and nor should yours if you care for security.

When you attempt to establish a connection, you will receive an
exception if the service is not running. If you try and run a query
but the service is not running, you will get an exception.

I do not know C#, but I would be extremely surprised if there is no
global exception handler you could not use to react appropriately to
an unavailable service.

You need to consider also that if it is not stopped by user
interaction, the service should never be down. If it does just go
down, you need to investigate why, because that is not normal.

As you are a beta tester, you should also try to determine whether
your issue is a consequence of any potential bug in Firebird 2.