issue with updatebatchsize
Posted: Thu 08 Oct 2015 13:41
i have following big problem optimizing my tmsqueries in cached updates mode.
Following scenario: simple tmsquery, batchupdatesize = 50, cached updates active, sql.text =
I'm appending 380 records:
now i want to save the inserts - but only the first 40. so i write following:
but this code does not save anything!
if i skip more records (more than updatebatchsize)
the first block of 50 gets saved. But the remaining 10 records again hang somewhere.
Please, correct the bug. Or, please, provide some other solution to pre-filter cached updates and save only some of the in one batch.
Thanks, Ludek.
Following scenario: simple tmsquery, batchupdatesize = 50, cached updates active, sql.text =
Code: Select all
select top 0 id from sysobjects
Code: Select all
Q.Open;
for i := 1 to 380 do begin
Q.append;
Qid.AsInteger := i;
Q.Post;
end;
Code: Select all
Q.OnUpdateRecord := Qupdaterecord;
Q.ApplyUpdates;
Q.OnUpdateRecord := nil;
Q.ApplyUpdates;
procedure TForm1.ScheGQUpdateRecord(DataSet: TDataSet; UpdateKind: TUpdateKind;
var UpdateAction: TUpdateAction);
begin
if Qid.AsInteger < 40 then
UpdateAction := uaSkip // should be saved with next call of applyupdates
else
UpdateAction := uaApplied; // mark as save, don't save any more
end;
if i skip more records (more than updatebatchsize)
Code: Select all
procedure TForm1.ScheGQUpdateRecord(DataSet: TDataSet; UpdateKind: TUpdateKind;
var UpdateAction: TUpdateAction);
begin
if Qid.AsInteger < 60 then
UpdateAction := uaSkip // should be saved with next call of applyupdates
else
UpdateAction := uaApplied; // mark as save, don't save any more
end;
Please, correct the bug. Or, please, provide some other solution to pre-filter cached updates and save only some of the in one batch.
Thanks, Ludek.