begin method

TxnContextV2 begin({
  1. bool readOnly = false,
})

Implementation

TxnContextV2 begin({bool readOnly = false}) {
  final txnId = _nextTxnId++;
  final activeSnapshot = Set<int>.from(_active.keys);

  final ctx = TxnContextV2(
    txnId:        txnId,
    snapshotTxnId: _lastCommitted,
    activeAtBegin: activeSnapshot,
    readOnly:     readOnly,
  );
  _active[txnId] = ctx;
  return ctx;
}