Firedac Refresh or Refreshrecord

Asked

Viewed 2,040 times

1

I’m going through an unusual situation with Firedac.

I use Delphi 2009 + Firedac V8.0.5.3365 and only one component ADQuery without DataSetProvider and ClientDataSet.

After the inclusion of a record through the ApplyUpdates(0), when I request a Refresh or Refreshrecord Firedac is recording the record twice more, causing a triplicity in inclusion. This has happened about three times in different tables.

I’ve tried to disable the CachedUpdates, but is in error if this change is made with Query open.

Has anyone been there? Know how to solve this situation?

2 answers

2

Apparently with the command: CommitUpdates after ApplyUpdates(0) I managed to solve two problems:

  1. Avoid triplicity of records in the table.
  2. Avoid errors in the command Refresh after inclusion / data change.

In the forum of the company Da-Soft (link below) has a support call that the solution is really this, call CommitUpdates shortly after ApplyUpdates(0).

Official Da-Soft response Anydac/Firedac developer

2) FAutoCommitUpdates is true only for TADMemTable. This is necessary for compatibility with TClientDataSet. For everyone else you have to call explicitly CommitUpdates after ApplyUpdates... dataset Anydac.

1

Try to check if in the event after refresh or before refresh or another event does not call back the inclusion procedure of this record.

I particularly work as follows:

In the fdquery leave a select and when I will enter a record I perform a append, then a post and then a refresh to update the grid, and I never got to have this problem.

If you ever work with begintrans and commit first apply the apply or the post and then perform the commit if not controlling transactions will not do much good.

Browser other questions tagged

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