internal OletxDependentTransaction DependentClone(bool delayCommit)
        {
            OletxDependentTransaction transaction = null;

            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceOletx"), "OletxTransaction.DependentClone");
            }
            if (TransactionStatus.Aborted == this.Status)
            {
                throw TransactionAbortedException.Create(System.Transactions.SR.GetString("TraceSourceOletx"), this.realOletxTransaction.innerException);
            }
            if (TransactionStatus.InDoubt == this.Status)
            {
                throw TransactionInDoubtException.Create(System.Transactions.SR.GetString("TraceSourceOletx"), this.realOletxTransaction.innerException);
            }
            if (this.Status != TransactionStatus.Active)
            {
                throw TransactionException.Create(System.Transactions.SR.GetString("TraceSourceOletx"), System.Transactions.SR.GetString("TransactionAlreadyOver"), null);
            }
            transaction = new OletxDependentTransaction(this.realOletxTransaction, delayCommit);
            if (DiagnosticTrace.Verbose)
            {
                MethodExitedTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceOletx"), "OletxTransaction.DependentClone");
            }
            return(transaction);
        }
Example #2
0
        internal OletxDependentTransaction DependentClone(
            bool delayCommit
            )
        {
            OletxDependentTransaction dependentClone = null;

            if ( DiagnosticTrace.Verbose )
            {
                MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ),
                    "OletxTransaction.DependentClone"
                    );
            }

            Debug.Assert( ( 0 == this.disposed ), "OletxTransction object is disposed" );

            if (TransactionStatus.Aborted == Status)
            {
                throw TransactionAbortedException.Create(SR.GetString(SR.TraceSourceOletx), SR.GetString(SR.TransactionAborted), realOletxTransaction.innerException, this.DistributedTxId);
            }
            if (TransactionStatus.InDoubt == Status)
            {
                throw TransactionInDoubtException.Create(SR.GetString(SR.TraceSourceOletx), SR.GetString(SR.TransactionIndoubt), realOletxTransaction.innerException, this.DistributedTxId);
            }
            if (TransactionStatus.Active != Status)
            {
                throw TransactionException.Create(SR.GetString(SR.TraceSourceOletx), SR.GetString(SR.TransactionAlreadyOver), null, this.DistributedTxId);
            }

            dependentClone = new OletxDependentTransaction( realOletxTransaction, delayCommit );

            if ( DiagnosticTrace.Verbose )
            {
                MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ),
                    "OletxTransaction.DependentClone"
                    );
            }

            return dependentClone;

        }