In the UniDAC documentation, it is written, that if FetchAll is enabled, Unidirectional cannot be enabled.
Currently in the UniDAC DA driver, Unidirectional is enabled, while FetchAll is disabled.
If FetchAll is disabled, another database connection will be needed (I think), to get all data.
I believe in the case of DA, all rows will be needed anyway, before data is returned to the client.
So currently I use the following code changes (for Query and Stored Procedure):
function TDAEUniDACQuery.CreateDataset(…)…
begin
***Corrected: TUniQuery(result).Unidirectional := False;
***Added: TUniQuery(result).SpecificOptions.Values[‘FetchAll’] := ‘True’;
end;
you can create descendant of UniDAC driver and override few methods like :
function TMyDAEUniDACConnection.GetDatasetClass: TDAEDatasetClass;
begin
Result := TMyDAEUniDACQuery;
end;
function TDAEUniDACQuery.CreateDataset(aConnection: TDAEConnection): TDataset;
begin
result := inherited CreateDataset(aConnection);
TUniQuery(result).Unidirectional := False;
TUniQuery(result).SpecificOptions.Values['FetchAll'] := 'True';
end;
function GetDriverObject: IDADriver;
begin
if (_driver = nil) then _driver := TMyDAEUniDACDriver.Create(nil);
result := _driver;
end;
initialization
_driver := nil;
UnregisterDriverProc(uDAUniDACDriver.GetDriverObject);
RegisterDriverProc(GetDriverObject);
finalization
UnregisterDriverProc(GetDriverObject);
FreeAndNIL(_driver);