TransactionCommit(Failure |
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
public TransactionStatus Commit( FailureHandlingOptions options )
Public Function Commit ( options As FailureHandlingOptions ) As TransactionStatus
public: TransactionStatus Commit( FailureHandlingOptions^ options )
member Commit : options : FailureHandlingOptions -> TransactionStatus
Parameters
- options FailureHandlingOptions
-
A set of options
to be used for handling eventual failures during this call.
The options are only used temporarily during the commitment process. After the transaction is finished, the options will be reset to their default values.
Return Value
TransactionStatusIf finished successfully, this method returns TransactionStatus.Committed
Note it is possible the RolledBack status is returned instead as an outcome of failure handling. If TransactionStatus.Pending is returned it means that failure handling has not been finalized yet and Revit awaits user's actions. Until committing is fully finalized, no changes to the document can be made (including starting of new transactions).
Be aware that the returned status does not have to be necessarily the same like the status returned by GetStatus even when the method is called immediately after committing the transaction. Such difference may happen due to actions made by a transaction finalizer, if there was one set. (See FailureHandlingOptions for more details.)

Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | The current status of the transaction is not 'Started'. Transaction must be started before calling Commit or Rollback. -or- The transaction's document is currently in failure mode. No transaction operations are permitted until failure handling is finished. |