当前位置: 首页>>代码示例>>C#>>正文


C# Transaction.GetHashCode方法代码示例

本文整理汇总了C#中System.Transactions.Transaction.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.GetHashCode方法的具体用法?C# Transaction.GetHashCode怎么用?C# Transaction.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Transactions.Transaction的用法示例。


在下文中一共展示了Transaction.GetHashCode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveDriverInTransaction

 public static void RemoveDriverInTransaction(Transaction transaction)
 {
     lock (driversInUse.SyncRoot)
     {
         driversInUse.Remove(transaction.GetHashCode());
     }
 }
开发者ID:BGCX261,项目名称:zp-mysql-data-svn-to-git,代码行数:7,代码来源:MySqlPromotableTransaction.cs

示例2: GetDriverInTransaction

 public static Driver GetDriverInTransaction(Transaction transaction)
 {
     lock (driversInUse.SyncRoot)
     {
         return (Driver) driversInUse[transaction.GetHashCode()];
     }
 }
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:DriverTransactionManager.cs

示例3: AddToConnectionInfoTable

 private void AddToConnectionInfoTable(Transaction transaction, SharedConnectionInfo connectionInfo)
 {
     lock (this.tableSyncObject)
     {
         this.transactionConnectionTable.Add(transaction, connectionInfo);
         WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, string.Concat(new object[] { "AddToConnectionInfoTable ", transaction.GetHashCode(), " in table of count ", this.transactionConnectionTable.Count }));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SharedConnectionWorkflowCommitWorkBatchService.cs

示例4: AddToConnectionInfoTable

 private void AddToConnectionInfoTable(Transaction transaction, SharedConnectionInfo connectionInfo)
 {
     lock (this.tableSyncObject)
     {
         this.transactionConnectionTable.Add(transaction, connectionInfo);
         WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, "AddToConnectionInfoTable " + transaction.GetHashCode() +
                 " in table of count " + this.transactionConnectionTable.Count); 
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:SharedConnectionWorkflowTransactionService.cs

示例5: RemoveConnectionFromInfoTable

 private void RemoveConnectionFromInfoTable(Transaction transaction)
 {
     lock (this.tableSyncObject)
     {
         SharedConnectionInfo connectionInfo;
         WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, "TransactionCompleted " + transaction.GetHashCode());
         if (transactionConnectionTable.TryGetValue(transaction, out connectionInfo))
         {
             connectionInfo.Dispose();
             this.transactionConnectionTable.Remove(transaction);
         }
         else
         {
             WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, "TransactionCompleted " + transaction.GetHashCode() +
                 " not found in table of count " + this.transactionConnectionTable.Count);                
         }
     } 
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:18,代码来源:SharedConnectionWorkflowTransactionService.cs

示例6: EnlistNonNull

 private void EnlistNonNull(Transaction tx)
 {
     if (Bid.AdvancedOn)
     {
         Bid.Trace("<sc.SqlInternalConnection.EnlistNonNull|ADV> %d#, transaction %d#.\n", base.ObjectID, tx.GetHashCode());
     }
     bool flag = false;
     if (this.IsYukonOrNewer)
     {
         if (Bid.AdvancedOn)
         {
             Bid.Trace("<sc.SqlInternalConnection.EnlistNonNull|ADV> %d#, attempting to delegate\n", base.ObjectID);
         }
         SqlDelegatedTransaction promotableSinglePhaseNotification = new SqlDelegatedTransaction(this, tx);
         try
         {
             if (tx.EnlistPromotableSinglePhase(promotableSinglePhaseNotification))
             {
                 flag = true;
                 this.DelegatedTransaction = promotableSinglePhaseNotification;
                 if (Bid.AdvancedOn)
                 {
                     long transactionId = 0L;
                     int objectID = 0;
                     if (this.CurrentTransaction != null)
                     {
                         transactionId = this.CurrentTransaction.TransactionId;
                         objectID = this.CurrentTransaction.ObjectID;
                     }
                     Bid.Trace("<sc.SqlInternalConnection.EnlistNonNull|ADV> %d#, delegated to transaction %d# with transactionId=0x%I64x\n", base.ObjectID, objectID, transactionId);
                 }
             }
         }
         catch (SqlException exception)
         {
             if (exception.Class >= 20)
             {
                 throw;
             }
             SqlInternalConnectionTds tds = this as SqlInternalConnectionTds;
             if (tds != null)
             {
                 TdsParser parser = tds.Parser;
                 if ((parser == null) || (parser.State != TdsParserState.OpenLoggedIn))
                 {
                     throw;
                 }
             }
             ADP.TraceExceptionWithoutRethrow(exception);
         }
     }
     if (!flag)
     {
         if (Bid.AdvancedOn)
         {
             Bid.Trace("<sc.SqlInternalConnection.EnlistNonNull|ADV> %d#, delegation not possible, enlisting.\n", base.ObjectID);
         }
         byte[] transactionCookie = null;
         if (this._whereAbouts == null)
         {
             byte[] dTCAddress = this.GetDTCAddress();
             if (dTCAddress == null)
             {
                 throw SQL.CannotGetDTCAddress();
             }
             this._whereAbouts = dTCAddress;
         }
         transactionCookie = GetTransactionCookie(tx, this._whereAbouts);
         this.PropagateTransactionCookie(transactionCookie);
         this._isEnlistedInTransaction = true;
         if (Bid.AdvancedOn)
         {
             long num2 = 0L;
             int num = 0;
             if (this.CurrentTransaction != null)
             {
                 num2 = this.CurrentTransaction.TransactionId;
                 num = this.CurrentTransaction.ObjectID;
             }
             Bid.Trace("<sc.SqlInternalConnection.EnlistNonNull|ADV> %d#, enlisted with transaction %d# with transactionId=0x%I64x\n", base.ObjectID, num, num2);
         }
     }
     base.EnlistedTransaction = tx;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:84,代码来源:SqlInternalConnection.cs

示例7: CreateVolatileEnlistment

        TransactionException CreateVolatileEnlistment(Transaction transactionToEnlist)
        {
            TransactionException result = null;
            PersistenceContextEnlistment enlistment = null;
            int key = transactionToEnlist.GetHashCode();
            lock (PersistenceContext.Enlistments)
            {
                try
                {
                    if (!PersistenceContext.Enlistments.TryGetValue(key, out enlistment))
                    {
                        enlistment = new PersistenceContextEnlistment(this.PersistenceContext, transactionToEnlist);
                        transactionToEnlist.EnlistVolatile(enlistment, EnlistmentOptions.None);
                        // We don't save of the Enlistment object returned from EnlistVolatile. We don't need
                        // it here. When our PersistenceContextEnlistment object gets notified on Prepare,
                        // Commit, Rollback, or InDoubt, it is provided with the Enlistment object.
                        PersistenceContext.Enlistments.Add(key, enlistment);
                    }
                    else
                    {
                        enlistment.AddToEnlistment(this.PersistenceContext);
                    }
                }
                catch (TransactionException txException)
                {
                    result = txException;

                    // We own the lock but failed to create enlistment.  Manually wake up the next waiter.
                    // We only handle TransactionException, in case of other exception that failed to create enlistment,
                    // It will fallback to Timeout.  This is safe to avoid multiple waiters owning same lock.
                    this.PersistenceContext.ScheduleNextTransactionWaiter();
                }
            }
            return result;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:35,代码来源:TransactionWaitAsyncResult.cs


注:本文中的System.Transactions.Transaction.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。