Page 1 of 1

"OnConnectionLost" event not firing

Posted: Fri 01 Feb 2008 09:45
by waeberd
Hi,

using ODAC6, the OnConnectionLost event is not fired if I force a disconnection.

Peeking at the sources / documentation, I found the following:
If a connection breaks, a fatal error occurs, and OnConnectionLost event will be raised if the following
conditions are fulfilled:
· There are no active transactions;
· There are no opened and not fetched datasets;
· There are no explicitly prepared datasets or SQLs.
I have a "prepared" stored procedure in my application which is preventing the event from being fired.

Why don't you fire this event in this situation? Because of inconsistencies?

Thanks, Daniel

Posted: Mon 04 Feb 2008 09:23
by Plash
OnConnectionLost event is intended to allow to reconnect to the database by setting RetryMode variable to rmReconnect or rmReconnectExecute. If a SQL statement was prepared, it cannot be executed after reconnect. So the event does not fired and reconnect does not occur.