Transaction.Commit(FailureHandlingOptions) Method

TransactionCommit(FailureHandlingOptions) Method

Commits all changes made to the model during the transaction.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
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

TransactionStatus
If 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.)

Exceptions
ExceptionCondition
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.
See Also