Hi Viktor!!
We 've a probleme with Rollback Transaction. We ´ve made a test case. ( one table, one transaction, one connection)
Embarcadero: Delphi Tokyo ( VCL)
var
vQuery : TIBCQuery;
tranUpdatetc: TIBCTransaction;
begin
IBCtable1.AutoCommit := false;
tranUpdatetc := TIBCTransaction.Create(IBCConnection1);
tranUpdatetc.DefaultConnection:=IBCConnection1;
tranUpdatetc.StartTransaction;
try
vQuery := TIBCQuery.Create(nil);
vQuery.AutoCommit:= false;
vQuery.UpdateTransaction:=tranUpdatetc;
vQuery.Connection := IBCConnection1;
vQuery.Sql.Add( 'UPDATE ELFORMULARIOS SET GENERADO = ''N''');
vQuery.ExecSQL;
if tranUpdatetc.Active = true then
Begin
tranUpdatetc.Rollback; ( we´re testing rollback, but it doesn't work)
End;
except
tranUpdatetc.Commit;
vQuery.Free;
tranUpdatetc.Free;
end;
end;
Can you help us? what´s happens?
Thanks in advanced
Angélica ( Arizmendi Team)
Problem with Rollback Transaction
-
- Posts: 10
- Joined: Fri 13 Jul 2018 18:36
Re: Problem with Rollback Transaction
Hi Viktor:
For us, the Connection must not have a default transaction, 'cause we´re using a lot transactions and one connecction.
Thanks in advance.
Angélica ( Arizmendi Team)
For us, the Connection must not have a default transaction, 'cause we´re using a lot transactions and one connecction.
Thanks in advance.
Angélica ( Arizmendi Team)
Re: Problem with Rollback Transaction
Note, that upon execution of the TIBCQuery.ExecSQL method, a transaction defined in the TIBCQuery.Transaction property, and not in the TIBCQuery.UpdateTransaction property, is used.
To solve your task in your sample, you can replace the code line
with
To solve your task in your sample, you can replace the code line
Code: Select all
vQuery.UpdateTransaction:=tranUpdatetc;
Code: Select all
vQuery.Transaction := tranUpdatetc;
-
- Posts: 10
- Joined: Fri 13 Jul 2018 18:36
Re: Problem with Rollback Transaction
Hi ViktorV:
It works excellent!!!!
Thanks a lot!!!
Angélica ( Arizmendi Team)
It works excellent!!!!
Thanks a lot!!!
Angélica ( Arizmendi Team)
Re: Problem with Rollback Transaction
It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.
Feel free to contact us if you have any further questions about our products.