Data.SqlExpr.TSQLConnection.RollbackIncompleteFreeAndNil
Delphi
procedure RollbackIncompleteFreeAndNil(var Transaction: TDBXTransaction);
C++
void __fastcall RollbackIncompleteFreeAndNil(Data::Dbxcommon::TDBXTransaction* &Transaction);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Data.SqlExpr.pas Data.SqlExpr.hpp |
Data.SqlExpr | TSQLConnection |
Description
Cancels all updates, insertions, and deletions for a specified transaction and ends the transaction.
Call RollbackIncompleteFreeAndNil to cancel any changes made during the transaction described by Transaction and to end it. Transaction is the TDBXTransaction returned by the BeginTransaction method when starting the transaction.
If the specified transaction is the only current transaction, RollbackFreeAndNil sets the InTransaction property to false after canceling the transaction.
Any active transactions that were begun after this transaction are effectively rolled back and freed as well.
The var Transaction instance is set to nil.
Unlike the RollbackFreeAndNil procedure, this procedure does not throw an exception if Transaction is invalid or set to nil. This method is ideally used in a finally (or except) block. The try block uses either CommitFreeAndNil or RollbackFreeAndNil, and the Transaction has already been completed, freed, and set to nil. If an exception is not raised in the try block, a call to RollbackIncompleteFreeAndNil in the finally block does nothing, because the Transaction instance is no longer valid. If an exception is raised, a call to RollbackIncompleteFreeAndNil in the finally block rolls back, frees, and sets the Transaction instance to nil.