How to disable AutoCommit on FireDac

1

How would it be to disable AutoCommit type:

FDTable1.AutoCommit := False;

or

FDconection.AutoCommit := False;

I'm not finding it.

    
asked by anonymous 04.07.2017 / 16:05

2 answers

3

You can do this:

FDConnection1.TxOptions.AutoCommit := False;
    
04.07.2017 / 16:14
3

I think it's worth pointing out that the AutoCommit option simply clears the UpdateStatus of the records. Unlike ApplyUpdates of ClientDataSet , which returned all records to usUnModified automatically, FDQuery maintains them. I imagine it is so that we can, after giving ApplyUpdates , make new changes to the database database according to the registration status.

So, if you run ApplyUpdates in a row (for some automation, for example), you may get a primary key error among others due to the attempt to perform the same operation twice.

    
02.08.2017 / 23:29