Subject Re: [IBO] How to Detect Whether Conection is Lost.
Author Jason Wharton
I use the Optimistic approach. I plow ahead until something goes wrong. In
which case you are going to get a notification from a failed API call. Trap
the error at the session level and set a flag in your application. When a
connection is lost the server does the cleanup it needs to so IBO disposes
of the handles it has and allows you to rollback and disconnect and then you
need to attempt to reconnect again.

It isn't really possible to get a connection back and start right where you
left off because you lose your transaction context. Therefore I don't try to
pretend that it is actually possible.

Jason Wharton
CPS - Mesa AZ

----- Original Message -----
From: "R. S. Patil" <rspatil@...>
To: <>
Sent: Monday, March 26, 2001 9:29 AM
Subject: Re: [IBO] How to Detect Whether Conection is Lost.

> Thanks Joseph,
> I gave lot of thinking to ur idea and rewrote query opening,
> append, edit, post, delete etc. etc.
> Functions. (Thank GOD while writing application i got an
> idea to create functions for Query Open, Append etc. etc.
> like IBQuery_Open(qry:TIB_Query) otherwise whole application
> might have to be modified).
> > One simple way to handle this, is through a timer that periodically
> > the connection status of your IB_Connection and takes appropriate action
> while testing Connection.Status the status wont get modified
> till some action on query is
> performed. so using it in a timer and checking fails. Its
> not possible to get status
> of connection by Status property.
> Can some body tell us how to check whether connection with
> server is lost.