internal KeyValueDBTransaction(KeyValueDB owner, KeyValueDB.ReadTrLink readLink) { _owner = owner; _readLink = readLink; _currentKeySector = null; _currentKeyIndexInLeaf = -1; _currentKeyIndex = -1; _prefix = EmptyByteArray; _prefixKeyStart = 0; _prefixKeyCount = (long)_readLink.KeyValuePairCount; }
internal void SafeUpgradeToWriteTransaction() { Debug.Assert(_currentKeySector == null); Debug.Assert(!IsWritting()); _owner.UpgradeTransactionToWriteOne(this, null); _readLink = null; }
private void UpgradeToWriteTransaction() { if (IsWritting()) return; _owner.UpgradeTransactionToWriteOne(this, _readLink); _readLink = null; var sector = _currentKeySector; for (int i = _currentKeySectorParents.Count - 1; i >= 0; i--) { var sectorParent = _currentKeySectorParents[i]; sector.Parent = sectorParent; sector = sectorParent; } }