cancelToTxnAsync Method @beta

Reverse and then cancel (make non-reinstatable) all operations back to a previous TxnId. By default, this method also abandons the locks that were acquired for those operations.

cancelToTxnAsync(txnId: string, args?: ReverseTxnArgs): Promise<void>

@note This method will also abandon locks associated with any later, reversed Txns, if they have not already been abandoned. For example, if a call to reverseTxns reverses Txn 2 without abandoning its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated with both Txn 1 and Txn 2.

@note If there are any outstanding uncommitted changes, they are reversed.

@returns A promise that resolves to success if the transactions were reversed and cleared, or rejects with an IModelError otherwise.

Parameter Type Description
txnId string a TxnId obtained from a previous call to getCurrentTxnId
args ReverseTxnArgs Optional arguments to control the behavior of the reverse operation, such as whether to abandon locks.

Returns - Promise

A promise that resolves to success if the transactions were reversed and cleared, or rejects with an IModelError otherwise.

Defined in

Last Updated: 05 May, 2026