"OnConnectionLost" event not firing

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
waeberd
Posts: 22
Joined: Tue 09 Nov 2004 06:48

"OnConnectionLost" event not firing

Post by waeberd » Fri 01 Feb 2008 09:45

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 04 Feb 2008 09:23

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.

Post Reply