CancelUpdates in CachedUpdates.

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MICHALA
Posts: 15
Joined: Tue 17 Jan 2017 18:35

CancelUpdates in CachedUpdates.

Post by MICHALA » Mon 05 Jun 2017 21:59

In ZEOS CancelUpdates

Code: Select all

if (not ZConnection1.InTransaction) then ZConnection1.StartTransaction;
ZQuery1.ApplyUpdates;
ZConnection1.Rollback;
ZQuery1.CancelUpdates;
after ApplyUpdates and Rollback, restores the old state in dbgrid from the cache.

Why in UniDAC

Code: Select all

if (not UniConnection1.InTransaction) then UniConnection1.StartTransaction;
UniConnection1.AutoCommit:=False;
UniConnection1.ApplyUpdates;
UniConnection1.Rollback;
UniQuery1.CancelUpdates;
UniQuery1.Refresh;
I have to use slow Refresh?!?

Michal

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: CancelUpdates in CachedUpdates.

Post by azyk » Mon 12 Jun 2017 12:43

Thank you for the information. We reproduced the described behavior and are investigating it. We will inform you about the results.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: CancelUpdates in CachedUpdates.

Post by azyk » Tue 31 Oct 2017 13:05

If in the provided code the UniConnection1.ApplyUpdates call is executed without errors, then the next call of UniQuery1.CancelUpdates will return to dataset the data that were in it when calling ApplyUpdates, but not calling Open. This behavior is correct. More details about CancelUpdates in our online documentation: https://www.devart.com/unidac/docs/?dev ... ates().htm

Post Reply