AnyDAC
ContentsIndexHome
PreviousUpNext
TADCustomConnection.OnRecover Event

Fires after AnyDAC discovered that connection to DBMS is losted.

Group
Links
Parameters 
Description 
ASender 
This connection object. 
AInitiator 
The interface of the object initially discovered error. 
AException 
The exception object describing losted connection issue. 
AAction 
The action AnyDAC should take after return from event handler. 

The OnRecover event fires after AnyDAC discovered that connection to DBMs is losted. The event handler can analyze the reason, ask user how to proceed, show some status and returns the action, AnyDAC should take:

Action 
Description 
faDefault 
If ResourceOptions.AutoReconnect =True, then AnyDAC will try to reconnect, otherwise will raise an exception, that connection is losted. By default ResourceOptions.AutoReconnect = False. 
faFail 
Close connection and raise an exception, that connection is losted. 
faRetry 
Try to reconnect. 
faCloseAbort 
Close connection and abort current operation. 
faOfflineAbort 
Switch connection to the offline mode and abort current operation. 

If event handler is not assigned, then AnyDAC will take default (faDefault) action. If after 3 trials connection cannot be restored, then AnyDAC will close connection and raise an exception, that connection is losted.

property OnRecover: TADConnectionRecoverEvent;
What do you think about this topic? Send feedback!