Is TIBCQuery able to check whether data successfully saved in Remote Server ?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sugi
Posts: 43
Joined: Wed 07 Dec 2016 02:05

Is TIBCQuery able to check whether data successfully saved in Remote Server ?

Post by sugi » Sun 17 Sep 2017 02:26

Hello,

I am using Borland C++ Buider 6 & some of my old project still using TIBDataSet from Borland.

Have problem with this TIBDataSet, due to bad LAN connection, sometimes when update applied not all data successfully saved in Remote Server.

The update applied to Master & Child table, and mostly only Master data saved in Remote Server, while Child data completely lost.

My guest is connection to Remote Server lost before update/insert Child data finished.

Is TIBCQuery have feature to check whether data are really saved in Remote Server?

Thanks in advance.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Is TIBCQuery able to check whether data successfully saved in Remote Server ?

Post by ViktorV » Mon 18 Sep 2017 08:43

There is no separate property or method in TIBCQuery to check whether the specific records were successfully saved on the server.
To solve the issue, you can try using TIBCConnection.OnConnectionLost:
In order to enable the OnConnectionLost event handler, set the TIBCConnection.Options.LocalFailover property to True. Note, that to use the OnConnectionLost event handler, you should add the MemData

Code: Select all

unit to the USES section of your unit. Below is a sample of using OnConnectionLost: 
procedure TForm1.Button1Click(Sender: TObject);
begin
  IBCConnection.Options.LocalFailover := True;
  IBCConnection.Open;
end;

procedure TForm1.IBCConnectionConnectionLost(Sender: TObject;
  Component: TComponent; ConnLostCause: TConnLostCause;
  var RetryMode: TRetryMode);
begin
  RetryMode := rmReconnectExecute;
end;
In this case, on connection lost, IBDAC will attempt to reconnect and rerun the failed operation. Reed more in IBDAC documentation: https://www.devart.com/ibdac/docs/Devar ... onLost.htm

The OnConnectionLost event occurs only when the following conditions are fulfilled:
- a fatal error occurs (one of the following: network_error, lost_db_connection, conn_lost, isc_net_read_err, isc_net_write_err, isc_conn_shutdown_err, isc_db_shutdown_err);
- there are no opened transactions in a connection that are not ReadOnlyReadCommitted (if connection has at least one opened transaction, which is not ReadCommitedReadOnly, FailOver does not execute. All ReadCommitedReadOnly transaction are restored with FailOver operation);
- there are no opened and non-fetched datasets;
- there are no explicitly prepared datasets or SQLs.
Please make sure that none of the conditions above is violated.
For more information, please read the IBDAC documentation: https://www.devart.com/ibdac/docs/index ... etwork.htm

Post Reply