Exemplo n.º 1
0
        private void Initialize(bool first)
        {
            if (m_disposed)
            {
                ThrowDisposed();
            }

            lock (m_lock)
            {
                m_readVersion = null;
                if (first)
                {
                    m_committedVersion = -1;                        // note: current fdb_c client does not reset commited version to -1 when calling fdb_transaction_reset()
                }
                m_buffer = new SliceBuffer(InitialBufferSize);
                if (first)
                {
                    m_clears         = new ColaRangeSet <Slice>(SliceComparer.Default);
                    m_writes         = new ColaOrderedDictionary <Slice, WriteCommand[]>(SliceComparer.Default);
                    m_readConflicts  = new ColaRangeSet <Slice>(SliceComparer.Default);
                    m_writeConflicts = new ColaRangeSet <Slice>(SliceComparer.Default);
                }
                else
                {
                    m_clears.Clear();
                    m_writes.Clear();
                    m_readConflicts.Clear();
                    m_writeConflicts.Clear();
                }

                m_retryCount          = 0;
                this.AccessSystemKeys = NO_ACCESS;
                this.NextWriteNoWriteConflictRange = false;
                this.ReadYourWritesDisable         = false;
            }
        }