delphi - ClientDataSet: Automatically apply the reconciled delta? -
in onreconcileerror
event clientdataset, can tell ramerge
, saves changes delta, ready apply updates without errors. there way tell dataset apply delta in onreconcileerror
event? can think of convoluted way check if errors reconciled in afterapplyupdates
event.
so did have centralized code applying updates, , realized best place check if user requested merge. may still need clean bit, might solution others running problem.
if(cds.changecount > 0)then begin fismerged := false; errors := cds.applyupdates(0); if(errors = 0)then begin cds.refresh; end //if there conflict, user might try merge. //if do, need reapply update. else if(fismerged)then begin errors := cds.applyupdates(0); if(errors = 0)then begin cds.refresh; end; end; end;
fismerged
class variable set in on reconciled handler.
action := handlereconcileerror(dataset, updatekind, e); if(action = ramerge)then begin fismerged := true; end;
Comments
Post a Comment