Transaction Commit Method |
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
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 a user actions. Until committing is fully finalized, no changes to the document can be made (including starting of new transactions).
The returned status does not have to be necessarily the same as the status returned by GetStatus even when the method is called immediately after committing the transaction. Such a difference may happen due to actions made by a transaction finalizer, if there was one set. (See FailureHandlingOptions for more details.)
| Exception | Condition |
|---|---|
| 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. |