Firedac only records when I close the connection with the bank

Asked

Viewed 196 times

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 ?

2 answers

0

I found that this Firedac flaw comes from many versions. I found an app made with Firedac in Delphi 2009 that is also having persistence problems. It’s called Admig. Here the curious can download and make sure: (https://www.admig.com/setup/setup.exe). To test just open the system and register a New Member, then navigate to the "Groups" option from the "Ministry" menu and fill in a new registration. Note the "Leader" combobox that the new member does not appear in the list. Then close the system and Log again, and return to the "Groups" register. There you will find the registered name now. This is the behavior that is present in many systems made with Firedac. Note that in Admig the developer even put a "Update" button on each registration screen to try to persist the data. But even that didn’t solve it. Admig developer used the Madshi component to manage the bugs. From time to time the error screen appears and there the version of the compiler used and the type of query component used, which in this case is Firedac. Madshi’s report is quite thorough and shows all these curious details of the application.

-2

I’m gonna go test the Unidac 'cause I think this Firedac is fucked up. There’s times you record, there’s times you don’t record.

  • 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.