Edit:
I can create helper to prevent dataset closing
Code: Select all
procedure TZConnectionHelper.ForceReconnect;
begin
if FConnection <> nil then
begin
DoBeforeReconnect;
ShowSqlHourGlass;
try
try
FConnection.Close;
except
Rollback; // decrement transaction count
end;
FConnection.Open;
finally
HideSqlHourGlass;
end;
DoAfterReconnect;
end;
end;
with bellow changes in unit ZDbcInterbase6
procedure TZInterbase6Connection.Close;
begin
if Closed or (not Assigned(PlainDriver)) then
Exit;
try
try
CloseTransaction;
except
end;
if FHandle <> 0 then
begin
GetPlainDriver.isc_detach_database(@FStatusVector, @FHandle);
FHandle := 0;
CheckInterbase6Error(GetPlainDriver, FStatusVector, ConSettings, lcDisconnect);
end;
finally
DriverManager.LogMessage(lcConnect, ConSettings^.Protocol,
'DISCONNECT FROM "'+ConSettings^.DataBase+'"');
inherited Close;
end;
end;