Message Trying to reconnect with DesconnectedMode ?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Gyliard
Posts: 1
Joined: Mon 28 Sep 2015 11:07

Message Trying to reconnect with DesconnectedMode ?

Post by Gyliard » Mon 28 Sep 2015 11:24

Dear,
I work with an unstable network. I checked the manual that these conditions should use the TuniConnection the parameters : LocalFailOver and DesconnectedMode .

At first it worked , but I need to show a Messaging on -off ' Trying to reconnect ' when the connection drops , and also a ' connection reestablished ' message when the connection back .

How can I do this?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Message Trying to reconnect with DesconnectedMode ?

Post by azyk » Wed 30 Sep 2015 12:01

You can output the message about connection loss in the TUniConnection.OnConnectionLost event handler. Note, that the TUniConnection.OnConnectionLost event does not take plase when the connection to SQL Server will be lost. This message takes place when UniDAC refers to server, and the connection has been lost already. To use OnConnectionLost, set the TUniConnection.Options.LocalFailover property to True. See more details in the documentation: https://www.devart.com/unidac/docs/?dev ... ilover.htm

You can output the message about connection restore in the TUniConnection.AfterConnect event handler.

Post Reply