AnyDAC
ContentsIndexHome
PreviousUpNext
TADDataSet.BeginBatch Method

Optimizes dataset functionality for batch updates.

Group
Links
Parameters 
Description 
AWithDelete: Boolean = False 
True if after call application will also delete records. 

Use BeginBatch method to disable resources consuming operations and setup dataset to perform maximum fast updates. The BeginBatch call disables:

  • dataware controls updatings;
  • constraints updating;
  • aggregates maintaining;
  • wait cursor showing;
  • similar resources consuming processing in DatS objects, which is not controlled through dataset API;

If batch algorithm calls Delete method, then set AWithDelete to True. BeginBatch calls cannot be nested, although AnyDAC will not raise exception on consequent calls. After finishing updates call EndBatch.

procedure BeginBatch(AWithDelete: Boolean = False);
ADQuery1.BeginBatch;
try
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ......
finally
  ADQuery1.EndBatch;
end;
What do you think about this topic? Send feedback!