Subject | RE: [firebird-support] Re: Firebird function to test if a database connection is not disconnected? |
---|---|
Author | Alan McDonald |
Post date | 2009-05-14T01:40:14Z |
> > you haven't said how you are actually maintaining a connection.As Helen says, all you need to do is 'SELECT 1 FROM RDB$DATABASE'
> > e.g. PHP can connection pool. so too can ISAPI but I don't know
> > which if either you are using.
> > The earlier PHP setup was a bit buggy with polling but the
> > current setup is quite reliable.
>
> The application is an ISAPI application written in C++. I wrote my own
> connection pool class but I do need to complete that class with some
> reconnection logic in case a connection happens to disconnect for some
> reason.
>
> I think it would be nice to have a FB client function that would allow
> us to test for a valid database connection. I am assuming that there
> is no such test, therefore I will likely end up looping through each
> connection to periodically test for inactive connections and reconnect
> them.
>
If you get an exception, then the connection is dropped.
If my ISAPI dll were written in IBO, I think the query alone would be enough
to make the connection anyway.
Alan