Page 1 of 1

problem with CachedUpdates and appending records

Posted: Fri 09 Jan 2009 09:19
by nowy
Hello,

I have installed ODAC 6.70 in Delphi 2006 and noticed the following
problem: if I use VirtualTable component with CachedUpdates then
new appended records will never be applied.

It seems that records appended in cache mode will always get urFail flag
thus they will never be committed and disappear after CancelChanges.


here is the code demonstrating the problem:

Code: Select all

  VirtualTable1.CachedUpdates := true;
  VirtualTable1.Open;
  for i := 1 to 3 do
  begin
    VirtualTable1.Append;
    VirtualTable1.Post;
  end;
  VirtualTable1.CommitUpdates;
  Assert(VirtualTable1.RecordCount = 3);
  VirtualTable1.CancelUpdates;
  // after CancelUpdates RecordCount will be 0
  // but it should be 3, as we already committed updates
  Assert(VirtualTable1.RecordCount = 3);

Could you please fix it?

Thank you and regards

Posted: Mon 12 Jan 2009 09:20
by Plash
We have fixed this problem. The fix will be included in the next build of ODAC.