-1
I am running a test with Fdconnection and Fdquery and Mysql database. In my test table there is only one field called key with Primary key. Running command below, rollback does not work.
Relate the item
FdConnection1.TxOptions.AutoCommit:=false;
FdConnection1.Connected:=true;
try
FdConnection1.StartTransaction;
FdQuery1.SQL.Text:=('insert into teste (chave) values (:chave)');
FdQuery1.ExecSQL('',['01']);
FdQuery1.ExecSQL('',['01']);
FDConnection1.Commit;
except
FDConnection1.Rollback;
showMessage('Erro');
end;
Running this command shows "error" message, but in the table you entered a record. It should be empty, right? If anyone can help, thank you.