I'm using Firedac + Firebird 2.5 + Delphi Rio 10.3.3 and Aurelius 5.2
i have de following code:
var
oTran, oTran2: IDBTRANSACTION;
begin
try
oTran := oManager1.connection.begintrasaction;
xxxxxxxx
oTra2 := oManager2.connection.beginTrasaction;
yyyyyyyyy
oTran2.commit;
oTran1.commit;
except
oTran2.roolback;
oTran1.roolback;
end
end;
this code is correct?
i monitored in the ibexerpt, the transaction only started in otran1, otran2 not started and not commit or roolback acording this code listed bottom
Aurelius nest transactions. If you are opening transactions in the same connection, then if there is already an open transaction and you open a second one, committing or rolling back the second transaction won't have any effect.
It's described in documentation:
OuterTransaction := Manager.Connection.BeginTransaction;
InnerTransaction := Manager.Connection.BeginTransaction;
InnerTransaction.Commit; // This has NO effect, the same for rollback.
OuterTransaction.Commit; // Commit (or Rollback) is effectively performed here
I'm not sure what do you mean by transaction nested? Aurelius does nest transactions. If you want each transaction to be independent of each other, you have to use different connections, or you can control the transactions directly in the underlying database access component (for example, TFDConnection if you are using FireDAC), instead of using Aurelius transactions.