Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: CachedUpdates don't work on Master/Detail
CachedUpdates don't work on Master/Detail
Posted: 2000/08/08 12:14
 
I have OCIQueries quMaster, quDetail and DataSources for them dsMaster, dsDetail.
I have quDetail.DataSource := dsMaster
After I updated both (it is important!) queries (quMaster.UpdatesPending = True and quDetail.UpdatesPending = True) I want to apply changes. I do the following (simplified code):
. db.StartTransaction;
. try
. quMaster.ApplyUpdates;
. quDetail.ApplyUpdates;
. db.Commit;
. quMaster.CommitUpdates;
. quDetail.CommitUpdates;
. except
. db.Rollback;
. end;
After that quMaster is updated, but quDetail isn't updated, without saying any errors!!!
The workaround I found is to clear quDetail.DataSource, apply updates and then restore it.
. Sav := quDetail.DataSource;
. quDetail.DataSource := nil;
// Applying updates (insert above code)
. quDetail.DataSource := Sav ;


RE: CachedUpdates don't work on Master/Detail
Posted: 2000/08/09 15:27
 
Hi !

This is not a bug, but more a limitation of current implementation of master/detail support. The issue is:
- when you change master record, detail query requeries your data. As part of that detail query lost all cached updates maded to it.
- quMaster.ApplyUpdates, CommitUpdates forces change of master record.

The only possible way to avoid this issue, is to use filter for filtering detail data. When filter is changed, TOCIQuery did not requery data and keep cached updates. But filtering is going locally. That is not very good ...