示例#1
0
        public override void UndoLog(ILogRecord record, ITransaction tran)
        {
            lock (this.lockObject)
            {
                var       undoContent = record.GetUndoContent();
                RowHolder rs          = new RowHolder(this.columnTypes, undoContent.DataToUndo);

                if (record.GetRecordType() == LogRecordType.RowModify)
                {
                    this.items.SetRow(undoContent.RowPosition, rs);
                }
                else if (record.GetRecordType() == LogRecordType.RowInsert)
                {
                    this.items.DeleteRow(undoContent.RowPosition);
                    this.rowCount--;
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
        }
示例#2
0
        public override void RedoLog(ILogRecord record, ITransaction tran)
        {
            lock (this.lockObject)
            {
                var       redoContent = record.GetRedoContent();
                RowHolder rs          = new RowHolder(this.columnTypes, redoContent.DataToApply);

                if (record.GetRecordType() == LogRecordType.RowModify)
                {
                    this.items.SetRow(redoContent.RowPosition, rs);
                }
                else if (record.GetRecordType() == LogRecordType.RowInsert)
                {
                    int ret = this.items.InsertRow(rs);
                    this.rowCount++;
                    Debug.Assert(ret != -1);
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
        }