Пример #1
0
        public IRootNode CreateWritableTransaction()
        {
            if (_writable)
            {
                throw new InvalidOperationException("Only readonly root node could be CreateWritableTransaction");
            }
            var node = new RootNodeV(_impl);

            node._writable     = true;
            node._root         = _root;
            node.CommitUlong   = CommitUlong;
            node.TransactionId = TransactionId + 1;
            node.TrLogFileId   = TrLogFileId;
            node.TrLogOffset   = TrLogOffset;
            node._ulongs       = _ulongs == null ? null : (ulong[])_ulongs.Clone();
            NodeUtilsV.Reference(_root);
            return(node);
        }
Пример #2
0
        public IRootNode Snapshot()
        {
            var snapshot = new RootNodeV(_impl);

            snapshot._writable     = false;
            snapshot._root         = _root;
            snapshot.CommitUlong   = CommitUlong;
            snapshot.TransactionId = TransactionId;
            snapshot.TrLogFileId   = TrLogFileId;
            snapshot.TrLogOffset   = TrLogOffset;
            snapshot._ulongs       = _ulongs == null ? null : (ulong[])_ulongs.Clone();
            if (_writable)
            {
                TransactionId++;
            }
            NodeUtilsV.Reference(_root);
            return(snapshot);
        }