Subject Re: [IBO] TIB_Connection Losing Connection. PLEASE HELP
Author Helen Borrie
At 11:45 AM 30-10-02 +0200, you wrote:
>ok i have narrowed it down a bit, this is what i have discovered,
>I have simulated the problem by starting the server and then killing the
>connections from another app.
>VerifiyConnection tells me if the connection is ok,
>when this is false i can set Connected to false and connected to True, so
>the reconnect works fine,
>But as soon as I run any queries against the server I see that there are
>some transactions linked to the TIB_Connection, and after that It cannot
>reconnect any more the exception is "Error writing to the connection"
>Now i assume i have to somehow cancel all the transactions before trying the
>reconnect, I have tried
>ForceDisconnect - This still raises the exception and does not disconnect
>I have tried CloseTransactions before calling forcedisconnect, still no luck

>So how can i simply cancel the transactions linked to it without the
>component trying to "write to the connection" upon reconnect?

Have you tried doing what (I believe) ib_connection does itself in
preparation for a controlled Disconnect, viz.

iterate through the Transactions[] array of the IB_Connection and kill
everything by calling Close on all of your transactions are set up
for explicit control, it should roll back every one.

AFAIK, CloseTransactions actually does this itself so it's not necessarily
going to be helpful.

The fact that this is an intermittent problem still tells me it's in the
network, either physical (horrendous to troubleshoot) or in other areas
like connection strings, possibly IB events maxing out some kind of
connection limit, or just rotten old NetBEUI if that's your network protocol.