1
I wonder if anyone’s been through this problem. I use Firedac with Firebird in Rad Studio 10.2 Tokyo, but I have tried several ways to record the transaction, but the record does not persist in the bank.
I used this code below as suggested by the Embarcadero documentation, but no combination of it works with me:
FDQuery1.CachedUpdates := True;
FDQuery1.Append;
...
FDQuery1.Post;
FDQuery1.Append;
...
FDQuery1.Post;
FDQuery1.Append;
...
FDQuery1.Post;
FDConnection1.StartTransaction;
iErrors := FDQuery1.ApplyUpdates;
if iErrors = 0 then begin
FDQuery1.CommitUpdates;
FDConnection1.Commit;
end
else
FDConnection1.Rollback;
I use Fdconnection and Fdquery and have tried using Fdschemaadapter, Cachedupdates, but no combination worked. The only solution that worked was to disconnect and activate the bank connection after the table Post:
FDConnection1.Connected := False;
FDConnection1.Connected := True;
I have always used transaction with Adoconnection and never had problems. But with Firedac is not working.
Someone’s been through this ?
Now there is no doubt that Delphi Tokyo’s Firedac is bugged. I solved the problem by replacing the Firedac component with Devart’s Unidac. It was enough to open the DFM and PAS of the project and exchange the inheritance. The advantage of Unidac is that it did not even need to use transaction, a simple Post was necessary to persist the data in the table. I tested the entire project and made sure the problem was solved. I am satisfied with Unidac.
– Henry ABM