コード例 #1
0
 internal Transaction(System.Transactions.IsolationLevel isoLevel, InternalTransaction internalTransaction)
 {
     TransactionManager.ValidateIsolationLevel(isoLevel);
     this.isoLevel = isoLevel;
     if (System.Transactions.IsolationLevel.Unspecified == this.isoLevel)
     {
         this.isoLevel = TransactionManager.DefaultIsolationLevel;
     }
     if (internalTransaction != null)
     {
         this.internalTransaction = internalTransaction;
         this.cloneId = Interlocked.Increment(ref this.internalTransaction.cloneCount);
     }
 }
コード例 #2
0
 internal Transaction(System.Transactions.IsolationLevel isoLevel, ISimpleTransactionSuperior superior)
 {
     TransactionManager.ValidateIsolationLevel(isoLevel);
     if (superior == null)
     {
         throw new ArgumentNullException("superior");
     }
     this.isoLevel = isoLevel;
     if (System.Transactions.IsolationLevel.Unspecified == this.isoLevel)
     {
         this.isoLevel = TransactionManager.DefaultIsolationLevel;
     }
     this.internalTransaction = new InternalTransaction(this, superior);
     this.cloneId = 1;
 }
コード例 #3
0
ファイル: Common.cs プロジェクト: bneuhold/pb-dev
 /// <summary>
 /// Podesavanje isolation levela za sve konekcije globalno.
 /// Svaka konekcija moze overrajdati svoj isolation level.
 /// </summary>
 /// <param name="isolation"></param>
 public static void SetIsolationLevel(System.Transactions.IsolationLevel isolation)
 {
     transactionIsolation = isolation;
 }
コード例 #4
0
 internal Transaction(OletxTransaction oleTransaction)
 {
     this.isoLevel = oleTransaction.IsolationLevel;
     this.internalTransaction = new InternalTransaction(this, oleTransaction);
     this.cloneId = Interlocked.Increment(ref this.internalTransaction.cloneCount);
 }
コード例 #5
0
        internal OletxTransactionManager(
            string nodeName
            )
        {
            lock ( ClassSyncObject )
            {
                // If we have not already initialized the shim factory and started the notification
                // thread, do so now.
                if (null == OletxTransactionManager.proxyShimFactory )
                {
                    Int32 error = NativeMethods.GetNotificationFactory(
                        OletxTransactionManager.ShimWaitHandle.SafeWaitHandle,
                        out OletxTransactionManager.proxyShimFactory
                        );

                    if ( 0 != error )
                    {
                        throw TransactionException.Create( SR.GetString( SR.TraceSourceOletx ), SR.GetString( SR.UnableToGetNotificationShimFactory ), null );
                    }

                        ThreadPool.UnsafeRegisterWaitForSingleObject(
                            OletxTransactionManager.ShimWaitHandle,
                            new WaitOrTimerCallback( OletxTransactionManager.ShimNotificationCallback ),
                            null,
                            -1,
                            false
                            );
                }
            }
            
            this.dtcTransactionManagerLock = new ReaderWriterLock();

            this.nodeNameField = nodeName;

            // The DTC proxy doesn't like an empty string for node name on 64-bit platforms when
            // running as WOW64.  It treats any non-null node name as a "remote" node and turns off
            // the WOW64 bit, causing problems when reading the registry.  So if we got on empty
            // string for the node name, just treat it as null.
            if (( null != this.nodeNameField ) && ( 0 == this.nodeNameField.Length ))
            {
                this.nodeNameField = null;
            }

            if ( DiagnosticTrace.Verbose )
            {
                DistributedTransactionManagerCreatedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ),
                    this.GetType(),
                    this.nodeNameField
                    );
            }

            // Initialize the properties from config.
            configuredTransactionOptions.IsolationLevel = isolationLevelProperty = TransactionManager.DefaultIsolationLevel;
            configuredTransactionOptions.Timeout = timeoutProperty = TransactionManager.DefaultTimeout;

            this.internalResourceManager = new OletxInternalResourceManager( this );

            dtcTransactionManagerLock.AcquireWriterLock( -1 );
            try
            {
                this.dtcTransactionManager = new DtcTransactionManager( this.nodeNameField, this );
            }
            finally
            {
                dtcTransactionManagerLock.ReleaseWriterLock();
            }
            
            if (resourceManagerHashTable == null)
            {
                resourceManagerHashTable = new Hashtable(2);
                resourceManagerHashTableLock = new System.Threading.ReaderWriterLock();
            }

        }