Subject Re: [IBO] Application not responding while connecting...etc.
Author lester@lsces.co.uk
> I am trying to implement a system to failover clients if the primary server
> fails (app uses IBO).

Been there - done that.

> I am 'Pinging' the database via a call to a SP which returns the current
> time.

Not ideal. I have a NON database messaging system working on
top that includes the time ping. This also allows me to
monitor that the network is actually working and take
evasive action. ( Frame Relay connections we have been
provided just do not work at times <g> )

> What I am struggling with is the complete loss of response from the
> application when the connection to the server is lost (eg. disconnect lan).

My system works with a connection to the database, but
actions to the sever are triggered via messages, so no
network - no messages. I then have a local timeout timer
which does a 'reset' if the operation is not completed ( up
to a MINUTE at times on 64k Frame Relay ).
What you have to remember here is that once the client 'asks
a question' it can't do any more until the reply comes in -
any break - no reply.
( Pulling the cable on a windows network can result in all
sorts of OTHER network faults which stop the client from
working AT ALL - that is another problem all together )

> Is it feasable to perform the connect, disconnect, ping etc from within a
> secondary thread? The main thread then using this connection (once it is set
> up)?

I hope so, I'm doing that. But I actually run the two
connections. The background thread is given a list of record
numbers that it downloads one at a time, while the main
thread does the 'other accesses' to the server.

> I guess the main question is "is IBO thread safe". I have looked at the IBO
> thread example, however this app seems to be missing the Connection
> deatails.

There is a grey area - in gds32.dll - but basically if set
up correctly the IBO is thread safe. I have a system which
works over 'questionable' links and when a 'transaction' to
the server times out it simply rolls back, reconnects and
tries again. The messaging system on top replaces IB events,
allows me to flag a single record as changed and only copy
it if required.

It's take 4 years to get there <g>

The MAIN part of the trick is that the clients all run off a
local copy of FB so the bulk of the system is always running
off-line ( this is the bit that can fail if WINDOWS decides
there is a network fault <g> ), it's only the network
updates that runfrom the server - or backup server if the
main server can't be seen.

That said - and I need a local stand alone mode anyway -
with the latest IBO, recovery from network problems should
NOT be a problem, so more detail on what you are trying to
actually do please.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services