Question: What differs the TpFIBDataSet.ApplyUpdToBase method from TpFIBDataSet.ApplyUpdates?
Answer: Both methods write changes made in the dataset to the database (if the CachedUpates dataset property is set to True). These methods show different behaviour when working with the local dataset cache.
Sending record changes to the database ApplyUpdates marks the records as processed. When changes of first N records have been successfully applied and N+1 changes were not applied, the transaction cannot be rolled back (as first N records are marked as processed, recurrent ApplyUpdates calls won’t be applied to their changes).
Unlike ApplyUpdates, ApplyUpdToBase does not do any operations with the local cache. This method only sends changes to the server. If you need to mark records as processed, you can use an additional CommitUpdToCache method.
So a successful execution of ApplyUpdates is similar to the consequence of two methods:
ApplyUpdToBase;with TpFIBDataSet1 do
try
ApplyUpdToBase;
UpdateTransaction.Commit;
CommitUpdToCach;
except
UpdateTransaction.RollBack;
raise
end;
If no errors occur after this code is executed, the changes will be successfully applied to the database, committed by Commit and the local dataset cache will be marked as applied. In case any errors occur after the execution of ApplyUpdToBase, all the applied changes will be rolled back (UpdateTransaction.RollBack), and the dataset will be prepared for a new execution.
We are a small software company with thousands of customers delivering comany wide systems including accounting, logistics, e-commerce, POS, sales etc etc. Several years ago, when we were still a very small company, we used Delphi 3 and Paradox combined with BDE. As our system (and customer base) grew I decided to switch to Delphi 5 and Interbase. Being a huge improvement over Delphi 3 and Paradox, I encountered numerous problems with IBX: memory leaks, performance issues and other problems. Borland was not to be bothered: IBX was provided "as is" and no support was avaliable.