Ejemplo n.º 1
0
        public void SetTransactionControl(Session session, int mode)
        {
            lock (base.Lock)
            {
                TransactionManagerMvcc mvcc;
                if (mode != 1)
                {
                    if (mode == 2)
                    {
                        goto Label_005B;
                    }
                }
                else
                {
                    TransactionManagerMV2PL rmvpl = new TransactionManagerMV2PL(base.database);
                    Interlocked.Exchange(ref rmvpl.GlobalChangeTimestamp, Interlocked.Read(ref this.GlobalChangeTimestamp));
                    rmvpl.LiveTransactionTimestamps.AddLast(session.TransactionTimestamp);
                    base.database.TxManager = rmvpl;
                }
                goto Label_00AA;
Label_005B:
                mvcc = new TransactionManagerMvcc(base.database);
                Interlocked.Exchange(ref mvcc.GlobalChangeTimestamp, Interlocked.Read(ref this.GlobalChangeTimestamp));
                mvcc.LiveTransactionTimestamps.AddLast(session.TransactionTimestamp);
                base.database.TxManager = mvcc;
                Label_00AA :;
            }
        }
Ejemplo n.º 2
0
        public void SetTransactionControl(Session session, int mode)
        {
            lock (base.Lock)
            {
                TransactionManagerMV2PL rmvpl;
                if (base.LiveTransactionTimestamps.Size() != 1)
                {
                    goto Label_00BC;
                }
                if (mode != 0)
                {
                    if (mode == 1)
                    {
                        goto Label_006B;
                    }
                }
                else
                {
                    TransactionManager2PL managerpl = new TransactionManager2PL(base.database);
                    Interlocked.Exchange(ref managerpl.GlobalChangeTimestamp, Interlocked.Read(ref this.GlobalChangeTimestamp));
                    managerpl.LiveTransactionTimestamps.AddLast(session.TransactionTimestamp);
                    base.database.TxManager = managerpl;
                }
                return;

Label_006B:
                rmvpl = new TransactionManagerMV2PL(base.database);
                Interlocked.Exchange(ref rmvpl.GlobalChangeTimestamp, Interlocked.Read(ref this.GlobalChangeTimestamp));
                rmvpl.LiveTransactionTimestamps.AddLast(session.TransactionTimestamp);
                base.database.TxManager = rmvpl;
                return;

                Label_00BC :;
            }
            throw Error.GetError(0xe75);
        }