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


C# Transaction.EnlistDurable方法代码示例

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


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

示例1: Enlist

 public void Enlist(Transaction tx)
 {
     tx.EnlistDurable(_transactionExecutionEnvironment.ResourceManagerId, this, EnlistmentOptions.None);
 }
开发者ID:Readify,项目名称:Neo4jClient,代码行数:4,代码来源:Neo4jTransactionResourceManager.cs

示例2: Enlist

 public void Enlist(Transaction tx)
 {
     tx.EnlistDurable(TransactionResourceId, this, EnlistmentOptions.None);
 }
开发者ID:KodrAus,项目名称:Neo4jClient,代码行数:4,代码来源:Neo4jTransactionResourceManager.cs

示例3: EnlistTransaction

        public override void EnlistTransaction(Transaction systemTransaction)
        {
            lock (m_syncRoot)
            {
                CheckClosed();

                if (systemTransaction == null)
                {
                    throw new ArgumentNullException("transaction");
                }

                HsqlEnlistment enlistment = m_enlistment;

                if (enlistment == null)
                {
                    enlistment = new HsqlEnlistment(this, systemTransaction);

                    if (!systemTransaction.EnlistPromotableSinglePhase(enlistment))
                    {
                        if (m_transaction == null)
                        {
                            BeginTransaction(HsqlConvert.ToIsolationLevel(systemTransaction.IsolationLevel));
                        }

                        enlistment.m_dbTransaction = m_transaction;
                        systemTransaction.EnlistDurable(enlistment.Rmid, enlistment, EnlistmentOptions.None);
                    }

                    m_enlistment = enlistment;

                    GC.KeepAlive(this);
                }
                else if (enlistment.Transaction != systemTransaction)
                {
                    throw new InvalidOperationException(
                        "Connection currently has transaction enlisted."
                        + "  Finish current transaction and retry."); // NOI18N
                }
            }
        }
开发者ID:plusql,项目名称:hsqldb-snapshot-20160112,代码行数:40,代码来源:HsqlConnection.Api.cs

示例4: Enlist

 public Transaction Enlist(Transaction tx)
 {
     tx.EnlistDurable(rmGuid, this, EnlistmentOptions.None);
     return tx;
 }
开发者ID:ArsenShnurkov,项目名称:npgsql,代码行数:5,代码来源:NpgsqlResourceManager.cs

示例5: Begin

        public void Begin(Transaction transaction)
        {
            lock (syncObject)
            {
                this.netTxState = TxState.Active;
                dtcControlEvent.Reset();

                Tracer.Debug("Begin notification received");

                if (InNetTransaction)
                {
                    throw new TransactionInProgressException("A Transaction is already in Progress");
                }

                try
                {
                    Guid rmId = ResourceManagerGuid;

                    // Enlist this object in the transaction.
                    this.currentEnlistment =
                        transaction.EnlistDurable(rmId, this, EnlistmentOptions.None);

                    Tracer.Debug("Enlisted in Durable Transaction with RM Id: " + rmId);

                    TransactionInformation txInfo = transaction.TransactionInformation;

                    XATransactionId xaId = new XATransactionId();
                    this.transactionId = xaId;

                    if (txInfo.DistributedIdentifier != Guid.Empty)
                    {
                        xaId.GlobalTransactionId = txInfo.DistributedIdentifier.ToByteArray();
                        xaId.BranchQualifier = Encoding.UTF8.GetBytes(Guid.NewGuid().ToString());
                    }
                    else
                    {
                        xaId.GlobalTransactionId = Encoding.UTF8.GetBytes(txInfo.LocalIdentifier);
                        xaId.BranchQualifier = Encoding.UTF8.GetBytes(Guid.NewGuid().ToString());
                    }

                    // Now notify the broker that a new XA'ish transaction has started.
                    TransactionInfo info = new TransactionInfo();
                    info.ConnectionId = this.connection.ConnectionId;
                    info.TransactionId = this.transactionId;
                    info.Type = (int) TransactionType.Begin;

                    this.session.Connection.Oneway(info);

                    if (Tracer.IsDebugEnabled)
                    {
                        Tracer.Debug("Began XA'ish Transaction:" + xaId.GlobalTransactionId.ToString());
                    }
                }
                catch (Exception)
                {
                    dtcControlEvent.Set();
                    throw;
                }
            }
        }
开发者ID:Redi0,项目名称:meijing-ui,代码行数:60,代码来源:TransactionContext.cs


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