예제 #1
0
        internal Transaction(System.Transactions.Transaction transaction, bool isAmbient)
        {
            this.internalTransaction = transaction;
            this.isAmbient = isAmbient;

            this.transactionId = Interlocked.Increment(ref transactionCounter);
            this.atomicSectionLock = new LightweightSpinLock();
            this.isolationLevel = this.MapIsolationLevel(transaction.IsolationLevel);

            this.aborted = false;

            this.registeredHandlers = new HashSet<ITransactionHandler>();

            this.internalTransaction.EnlistVolatile(this, System.Transactions.EnlistmentOptions.EnlistDuringPrepareRequired);
        }
예제 #2
0
        public Transaction Snapshot()
        {
            _isolationLevel = IsolationLevels.Snapshot;

            return(this);
        }
예제 #3
0
        public Transaction Serializable()
        {
            _isolationLevel = IsolationLevels.Serializable;

            return(this);
        }
예제 #4
0
        public Transaction RepeatableRead()
        {
            _isolationLevel = IsolationLevels.RepeatableRead;

            return(this);
        }
예제 #5
0
        public Transaction ReadCommitted()
        {
            _isolationLevel = IsolationLevels.ReadCommitted;

            return(this);
        }
예제 #6
0
        public Transaction Chaos()
        {
            _isolationLevel = IsolationLevels.Chaos;

            return(this);
        }
예제 #7
0
        public Transaction Unspecified()
        {
            _isolationLevel = IsolationLevels.Unspecified;

            return(this);
        }