Subject Re: [IBO] Performance improvements when refreshing a dataset
Author Markus Ostenried
And on the dataset receiving the update you probably have to do this:

Dataset1.DMLCacheFlags := [ dcfReceiveEdit,dcfReceiveInsert, dcfReceiveDelete ];

On Mon, Feb 16, 2015 at 10:37 PM, Markus Ostenried <magnoz@...> wrote:
You could try using the DML cache feature -- IBO datasets can use it to notify each other of changes.

Maybe something like this works:

procedure TDataModule1.AnnounceDMLCacheItemKey;
  LKeyFieldNames: String; 
  LKeyFieldValues: Variant;
  LDMLCacheItemType: TIB_DMLCacheItemType
  LKeyFieldNames := 'c_id_client';
  LKeyFieldValues := 1;
  LDMLCacheItemType := ditInsert;
  IB_Connection.ProcessDMLCacheItem( AKeyFieldNames, AKeyFieldValues, ADMLCacheItemType );


On Mon, Feb 16, 2015 at 10:18 PM, Robert Martin rob@... [IBObjects] <> wrote:


I have a query where sometimes I need to refresh the selected record (A)
and other times where I know and item has been added (by another
process) and I need to refresh and select this item (B).

Historically I have simply done the following (depending on the situation)

(A) Query.Refresh

(B) Query.Refresh followed by Query.Locate()

I have replaced (A) with the following

(A) Query.InvalidateRowNum(Query.InternalDataset.RowNum)

This is massively quicker on large datasets.

I would like to speed up (B) if possible, but am not sure how to go
about this. I don't need to refresh all the other records, I just need
to add the new record into the dataset and move to it. My code knows
the Primary key field value of the newly added record. I am using IBOQuery.

Any suggestions ?