Cached Update Problem (BDE 5.01, D3, D4)
Hi,
I discovered a serious problem when using cached updates.
I try to insert records on master/detail tables with cached updates enabled.
If insertion in then detail table fails for any reason (during
Database.ApplyUpdates) the master record seems to disappear. So when the
(cached) detail records are corrected and Database.ApplyUpdates is called
again I get the message "Master record missing". When I call Table.Edit on
the master table after the failed Update I get the message "Record/Key
Deleted" or sometimes "At end of table".
This occurs either on local databases (Paradox) or SQL servers (ORACLE).
!!! BDE Version is 5.01. Delphi V3 and V4.
There is a similar behavior at the example below using a single table:
begin
Database1.StartTransaction;
try
Table1.ApplyUpdates;
{****************
Try to do something and raise an exeption
*****************}
Database1.Commit;
except
Database1.Rollback;
raise; {raise the exception to prevent a call to CommitUpdates!}
end;
Table1.CommitUpdates; {on success, clear the cache}
end;
Something happens on the modified records of Table1 !!!!
How can I overcome this problem ?