Sometimes, when the connection is lost, we get an exception "Access violation at address 008FAA04 in module 'DSServer.exe'. Read of address 000000E0"
Error in function TCustomDAConnection.DetectConnLostCause
See comment in code
Code: Select all
function TCustomDAConnection.DetectConnLostCause(Component: TObject): TConnLostCause;
var
i: integer;
AllowFailOver: boolean;
begin
Result := clUnknown;
AllowFailOver := True;
for i := FOperationsStackLen - 1 downto 0 do begin
if Result < FOperationsStack[i].Operation then begin
Result := FOperationsStack[i].Operation;
AllowFailOver := FOperationsStack[i].AllowFailOver;
end;
case Result of
clConnect: begin
// if TCustomDAConnection(Component).FShouldShowPrompt then
{==Vs====================================================================}
if Assigned(Component) and TCustomDAConnection(Component).FShouldShowPrompt then
{==Vs====================================================================}
Result := clUnknown;// This is the first connect or non DisconnectedMode - so we should raise exception
break;
end;
clOpen, clExecute: begin
if ((Component is TCustomDADataSet) and not TCustomDADataSet(Component).IsQuery) or
(Component is TCustomDASQL) then
Inc(FConnectCount); // Add ConnectCount - > cause of EndConnection in TCustomDADataSet.DoAfterExecute
end;
end;
end;
if not AllowFailOver then
Result := clUnknown;
case Result of
clExecute, clOpen, clServiceQuery, clTransStart:
if not IsFailOverAllowed then
Result := clUnknown; //can't perform FailOver cause of possible unnoticed server changes lost
end;
end;
Thanks