Subject | Re: [IBO] TIB_Connection Losing Connection, more problems |
---|---|
Author | lester@lsces.co.uk |
Post date | 2002-11-05T08:10:15Z |
> so ok how can i do this then:Why?
> I have one thread that checks the connection, and another thread executes
> queries. Is there a procedure or something in the IBO connection i can call,
> something like a critical section so that it would make this call thread
> safe,
If the query fails then handle the failure. If that is
because the connection has been lost, then remake the
connection.
I have had major problems in the past because of the failure
of the network connections ( third party problems <g> ). In
order to get round this I have added lots of checks and
timeouts. I have a timeout that closes the connection after
say 1/2 an hour of inactivity ( no trains overnight ), and
the queries just open a connection if it is not open. If a
get a fault report, or a query is taking too long, then I
close the connection and then try and remake after a pause.
If the re-open fails, then I start checking to see if the
network is still accessable - outside IBO/Firebird. Since
the third party fixed the network, there have only been
ocasional soft resets - probably due to windows ( close/open
) and no hard resets ( try rebooting windows <g> ).
I can understand wanting to know that the connection is
active, but the failure is just as likely to happen ( sods
law - will always happen ) in the middle of a query, and so
it is the query that needs to be handled, not the
connection. At the present time you can't establish why a
query may be taking too long. All mine should be sub 10
seconds on a 64kBaud connection, so anything over 30 seconds
is a problem which is handled.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services