Cancel recordlog in cachedupdate

SvenHeuer

Member²
Hi Marco,

is it possible to cancel the change of only one record (after i scrolled to another record)? Something like this:

DataSet.Cancel;
bm := DataSet.GetBookmark;
Log := DataSet.FindChangeLogByBookmark(PInteger(bm)^) as TChangeLogItem;
DataSet.FreeBookmark(bm);
Log.Cancel;

I can't do this, because the needed functions are protected or not visible out of OracleData.pas

The following does not clear the Log for the current record. Is this a WAD (Works As Designed)?

KPDM.qryTops.Cancel;
KPDM.qryTops.RefreshRecord;

Thanks for help

Sven
 
Ok, i added a new procedure

procedure TOracleDataset.CancelRecordUpdate;
Var
Log : TChangeLogItem;
BM : TBookmark;
begin
inherited;
if State in [dsEdit, dsInsert] then
Cancel;
bm := GetBookmark;
Log := FindChangeLogByBookmark(PInteger(bm)^) as TChangeLogItem;
FreeBookmark(bm);
If Assigned(log) then
begin
Log.Cancel;
Log.Free;
Resync([]);
end;
end;

Seemed to work :)

Greetings
Sven
 
To answer your first question: it does indeed work as designed. Once a record is posted (in this case to the local change log), the Cancel or RefreshRecord function will not help.

I have added your CancelRecordUpdate to the list of enhancement request. Maybe we should call it CancelCachedUpdate.
 
Back
Top