why you don't put myconnection.ping as function? returning the latency of the server like Smallint: 30 40 50 (ms)?
a question: i have a server with timeout 15secs, i can't change it because is a big host, lots of DBs...
to keep the connection alive im using a TTimer... every 7seconds i send a MyConnection.ping, but eventually, one or two times a day i get an connection lost error...
what to do about it? i tried the "DissconectedMode := true" but it does not work for me
im using in my project MyDAC 5.70 Std.
MyConnection.ping as function
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Re: MyConnection.ping as function
Hi Frega, you need to use LocalFailOverFrega wrote:why you don't put myconnection.ping as function? returning the latency of the server like Smallint: 30 40 50 (ms)?
a question: i have a server with timeout 15secs, i can't change it because is a big host, lots of DBs...
to keep the connection alive im using a TTimer... every 7seconds i send a MyConnection.ping, but eventually, one or two times a day i get an connection lost error...
what to do about it? i tried the "DissconectedMode := true" but it does not work for me
im using in my project MyDAC 5.70 Std.
Set in TMyConnection.Options.LocalfailOver = True
in OnConnectionLost Event insert the code
Code: Select all
RetryMode := rmReconnectExecute;
you can see MyDAC Demo.. it's have a full demo of LocalFailOver and Disconnected Model.