I am using the code below to manage transactions in my application.
Code: Select all
procedure TForm1.DoTransaction(DataSet: TDataSet);
begin
with ZConnection1 do
begin
if not AutoCommit then
begin
StartTransaction; //Gives me an error 'invalid operation in non AutoCommit mode'
try
Commit;
except
Rollback;
end;
Dataset.Refresh;
end;
end;
end;
Code: Select all
StartTransaction
Is this normal? Why should the explicit call to "StartTransaction" on a Zeos connection generate an error? Does setting "AutoCommit := False" implicitly start a transaction? Is it one or the other but not the two at the same time?
Thanks for your assistance.
JD