RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLConnection.RollbackIncompleteFreeAndNil Method

Cancels all updates, insertions, and deletions for a specified transaction and ends the transaction.

Pascal
procedure RollbackIncompleteFreeAndNil(var Transaction: TDBXTransaction);
C++
__fastcall RollbackIncompleteFreeAndNil(TDBXTransaction 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

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!