AnyDAC
ContentsIndexHome
PreviousUpNext
TADTopResourceOptions.AutoReconnect Property

Controls automatic connection recovery.

Group
Links

Use AutoReconnect property to control automatic connection recovery feature. 

Set it to True, so when AnyDAC will discover that connection is broken, it will try to transparently reestablish it. If it is False, then AnyDAC will raise exception and will not try to reconnect. 

Application can control connection recovery, using TADCustomConnection events. See TADCustomConnection.OnRecover for details. It is important to understand, that 100% transparent recovery is not possible. After connection is recovered:

  • all datasets has the same Active state as before connection recovery;
  • all datasets has the same Prepared state as before connection recovery;
  • all not yet fetched records are discarded and corresponding cursors are closed;
  • all transactions are inactive;
  • all event alerters are unregistered.

An application will need to take similar actions, as after logging to the DBMS server.

property AutoReconnect: Boolean;
What do you think about this topic? Send feedback!