we are using cached updates like and after update to 7.2.10 from 7.2.4? we found a problem
Start autocomit trasaction -> update datasets1 in cached updates mode -> start explicit transaction -> update datasets2 in cached mode -> commit explicit transaction -> continue in editation od dataset1
and now all datasets from first autocommit transactions are closed, I see new code in TZAbstractConnection.Commit there was added
Code: Select all
for i := 0 to FDatasets.Count -1 do
if Assigned(FDatasets[i]) And
(TObject(FDatasets[i]) is TZAbstractDataset) and
TZAbstractDataset(FDatasets[i]).CachedUpdates and
TZAbstractDataset(FDatasets[i]).UpdatesPending then
TZAbstractDataset(FDatasets[i]).ApplyUpdates;
thx
Stan
Edit: reverted code works fine
Code: Select all
procedure TZAbstractConnection.Commit;
var
ExplicitTran: Boolean;
i: Integer;
begin
CheckConnected;
CheckNonAutoCommitMode;
ExplicitTran := FExplicitTransactionCounter > 0;
if FExplicitTransactionCounter < 2 then
//when 0 then AutoCommit was turned off, when 1 StartTransaction was used
begin
ShowSQLHourGlass;
try
{ TODO -oEgonHugeist : Change this code sequence on 7.3! My automation idea simply is wrong! A commit vs. commitupdate(clear the cache) shouldn't be same! }
//See: http://zeoslib.sourceforge.net/viewtopic.php?f=38&t=19800
for i := 0 to FDatasets.Count -1 do
if (TObject(FDatasets[i]) is TZAbstractDataset) and (not THack_ZAbstractDataset(FDatasets[i]).UpdatesPending) then
if Assigned(FDatasets[i]) then
THack_ZAbstractDataset(FDatasets[i]).DisposeCachedUpdates;
FConnection.Commit;
finally
HideSQLHourGlass;
end;
FExplicitTransactionCounter := 0;
if ExplicitTran then
AutoCommit := True;
DoCommit;
end
else
Dec(FExplicitTransactionCounter);
end;