getIndirectTxn Method @beta

Returns the transaction to use for additional edits from an element, model, or aspect callback. In callbacks whose arguments provide an IModelDb but no transaction, obtain this transaction through arg.iModel.getIndirectTxn() and pass it to APIs that accept an EditTxn.

If an explicit transaction is active, this returns that transaction. Otherwise, it returns the implicit transaction used by legacy write paths. Callbacks that receive an indirectEditTxn argument should use that transaction directly.

getIndirectTxn(): EditTxn

@note The operation that invoked the callback owns the transaction. Callback implementations must not invoke transaction lifecycle methods such as EditTxn.start, EditTxn.end, saveChanges, abandonChanges, or onClose.

Returns - EditTxn

Defined in

Last Updated: 03 September, 2026