Proper way to handle a database connection lost
Posted: Fri 15 Mar 2013 11:43
My application open the connection on the start and keeps it opened till the application, I think all desktop application working this way.
I have a customer that I am having connection issues, the application lost the database connection, and raises the message "Unable to complete network request to host "SERVER-NAME". Error writing data to the connection".
This happens when the computer client lost internet ( ADSL ) connection.
What is the best approach to handle or fix this.
I am thinking about the OnConnectionLost event and make this:
Is this ok?
Thanks.
I have a customer that I am having connection issues, the application lost the database connection, and raises the message "Unable to complete network request to host "SERVER-NAME". Error writing data to the connection".
This happens when the computer client lost internet ( ADSL ) connection.
What is the best approach to handle or fix this.
I am thinking about the OnConnectionLost event and make this:
Code: Select all
procedure TdmSistema.ibDAFConnectionLost(Sender: TObject; Component: TComponent;
ConnLostCause: TConnLostCause; var RetryMode: TRetryMode);
begin
RetryMode := rmReconnect;
end;
Thanks.