startTransaction method

bool startTransaction([
  1. String? tname
])

Begin a transaction, where the changes are held by a Transaction object as the value of #currentTransaction. You must call either #commitTransaction or #rollbackTransaction afterwards.

For convenience, this method is called by Model#startTransaction and Diagram#startTransaction.

Transactions can be nested. Starting or ending a nested transaction will return false. Nested transactions will share the same Transaction list of ChangedEvents.

Starting a transaction will not necessarily cause #currentTransaction to be non-null. A Transaction object is usually only created by #handleChanged when a ChangedEvent first occurs. @param {string=} tname a short string describing the transaction, pushed onto the #nestedTransactionNames stack. @return {boolean} true if starting a top-level transaction. @see #commitTransaction @see #rollbackTransaction

Implementation

_i2.bool startTransaction([_i2.String? tname]) => _i4.callMethod(
      this,
      'startTransaction',
      [tname ?? _i5.undefined],
    );