FireDAC Refresh or RefreshRecord

1

I'm going through an unusual situation with FireDAC.

I use Delphi 2009 + FireDAC v8.0.5.3365 and only one component ADQuery with DataSetProvider and ClientDataSet .

After adding a record through ApplyUpdates(0) , when I request a Refresh or RefreshRecord FireDAC is recording the record two more times, causing a triplicity in inclusion . This has happened about three times on different tables.

I have tried to disable CachedUpdates , but it displays an error if this change is made with Query opened.

Has anyone ever gone through this? Do you know how to solve this situation?

    
asked by anonymous 29.12.2015 / 18:52

2 answers

2

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

  • Avoid triplicity of records in the table.
  • Avoid errors in the Refresh command after adding / changing the data.
  • In the Da-Soft company forum (link below) there is a support call that the solution is really this, call CommitUpdates soon after ApplyUpdates(0) .

    official Da-Soft AnyDac / FireDac developer response

      

    2) FAutoCommitUpdates is true only for TADMemTable . This is required for compatibility with TClientDataSet . For all others you have to explicitly call CommitUpdates after ApplyUpdates ... AnyDAC dataset.

        
    29.12.2015 / 22:35
    1

    Try to check whether the event after refresh or before refresh or other event does not call back the procedure to include this record.

    I particularly work as follows:

    No fdquery I leave a select and when I insert a record I make a append , then a post and then yes a refresh to update the grid, and I never had this problem. / p>

    If you get to working with begintrans and commit , first apply apply or post and then commit otherwise transaction control will not do much.

        
    30.12.2015 / 13:45