Subject DMLCache Receive/Announce mechanism
Author Sergey
Hi folks,

I have a functional problem using DML cache mechanism. Let me try to
explain.

I use DML cache to notify datasets on forms across application.
Within one form I have two datasets connected as master-detail.

MasterQuery receives DML notifications. DetailQuery sends DML
notifications.

When MasterQuery receives notification, it calls its own RefreshKeys
method (I use a stored procedure to populate MasterQuery). Everything
looks good except of when I try to delete a record from DetailQuery.
What happens (as per my understanding) is MasterQuery receives DML
notification and refreshes data before DetailQuery completes deletion
process. As I result of this I get an error message "Invalid reference
to Delete" (IB_NodeList, procedure TIB_NodeList.CurrentDelete, 1203).

Is there any way to deal with this situation and make it so
notification sent after deletion process is complete?

The only workaround I found is to put:

- DetailQuery.DataSource := nil in OnBeforeDelete event for DetailQuery
- DetailQuery.DataSource := MasterDatasource in OnAfterDelete event
for DetailQuery

Thanks,
Sergey