Exemplo n.º 1
0
        public override Row GetNewCachedObject(Session session, object obj)
        {
            int num2 = this._rowIdSequence;

            this._rowIdSequence = num2 + 1;
            int position = num2;

            if (this._isCached)
            {
                Row row2 = new RowAVLDisk(base.table, (object[])obj);
                this.Add(row2);
                if (this._isTempTable)
                {
                    RowAction.AddInsertAction(session, base.table, row2);
                }
                return(row2);
            }
            this._memoryRowCount++;
            if (this._useCache && (this._memoryRowCount > this._maxMemoryRowCount))
            {
                this.ChangeToDiskTable();
                return(this.GetNewCachedObject(session, obj));
            }
            RowAVL row = new RowAVL(base.table, (object[])obj, position);

            row.SetNewNodes();
            if (this._isTempTable)
            {
                RowAction action = new RowAction(session, base.table, 1, row, null);
                row.rowAction = action;
            }
            return(row);
        }
Exemplo n.º 2
0
        public override Row GetNewCachedObject(Session session, object obj)
        {
            int num;

            lock (this)
            {
                int rowIdSequence = this.RowIdSequence;
                this.RowIdSequence = rowIdSequence + 1;
                num = rowIdSequence;
            }
            RowAVL row = new RowAVL(base.table, (object[])obj, num);

            row.SetNewNodes();
            if (session != null)
            {
                RowAction action = new RowAction(session, base.table, 1, row, null);
                row.rowAction = action;
            }
            return(row);
        }