TDatabase's Transaction VS TTable's CachedUpdates

Hi,

From the example in D3 help on TDatabase, it uses ApplyUpdates to put the
"Cached" record(s) of TTable into TDatabase(If my understanding is right).
But a question arise: Why use both TTable's cachedUpdates and TDatabase's
transaction?  Why Don't use either one?  or just use TDatabase's transaction?
If I don't turn on CachedUpdates properties and just use StartTransaction(),
what would be affected or happened?

Thanks for any idea and comments.

Jonathan Chiu
jchc...@usa.net

From Help:
==========
procedure ApplyButtonClick(Sender: TObject);
begin
  with CustomerQuery do
  begin
  Database1.StartTransaction;
    try
      ApplyUpdates; {try to write the updates to the database};
      Database1.Commit; {on success, commit the changes};
    except
      Database1.Rollback; {on failure, undo the changes};
    raise; {raise the exception to prevent a call to CommitUpdates!}
    end;
  CommitUpdates; {on success, clear the cache}
  end;
end;

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own