commit method

bool commit()

Commits the transaction.

Returns true on success. A busy native transaction remains active for retry.

Implementation

bool commit() {
  if (_state != _State.active) {
    return false;
  }
  final Object provider = _backend;
  final status = provider is TransactionCompletionStatus
      ? provider.commitTransactionStatus(_txnId)
      : (_backend.commitTransaction(_txnId) ? 0 : 1);
  final ok = status == 0;
  if (status != 2) {
    _state = ok ? _State.committed : _State.failed;
    _detachFinalizer();
  }
  return ok;
}