MSDTC事务管理器无法从源事务管理器中提取事务

时间:2013-02-17 11:03:10

标签: c# asp.net database sql-server-2008

我有以下使用transactionScope

的代码
using (TransactionScope scope = new TransactionScope())
{
    MamConfiguration oldConfiguration;
    int oldTestId;
    using (mamdbEntities = new MaMDBEntities())
    {
        oldConfiguration = GetOldTestId(item.TestID);
        if (oldConfiguration == null)
        {
            ...

            ConvertToEfAndSave(item, oldTestId, oldConfiguration.CreatedDate);
            if(!item.UserMessage.IsErrorOccur)
            {
                scope.Complete();
            }
        }

交易失败,并出现以下错误:

17 Feb 2013 09:34:01,359||[15]||ERROR||MamInfrastructure.Logger.Log4NetLogger||Faild Update configuration to DB
System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)
   at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim)
   at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
   --- End of inner exception stack trace ---
   at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
   at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx)
   at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx)
   at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)
   at System.Transactions.Transaction.Promote()
   at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
   at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
   at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at Conduit.Mam.MaMDBEntityFramework.MamConfigurationBlDal.DeleteOldConfigurationTestId(Int32 testId) in d:\Builds\TFS\10\281\Sources\Server\MamAdmin\Dev\Admin 1.5\MaMDBEntityFramework\MamConfigurationBlDal.cs:line 135
   at Conduit.Mam.MaMDBEntityFramework.MamConfigurationBlDal.Save(MamConfigurationBL item) in d:\Builds\TFS\10\281\Sources\Server\MamAdmin\Dev\Admin 1.5\MaMDBEntityFramework\MamConfigurationBlDal.cs:line 77
   at Conduit.Mam.BL.SaveTestToDB.UpdateConfiguration(ABTest configuration, Boolean isProduction, Int32 testID) in d:\Builds\TFS\10\281\Sources\Server\MamAdmin\Dev\Admin 1.5\MaMBL\SaveTestToDB.cs:line 70
   at Conduit.Mam.Admin.Controllers.HomeController.Update(String expression, Boolean isProductionMode, Int32 testId) in d:\Builds\TFS\10\281\Sources\Server\MamAdmin\Dev\Admin 1.5\MAMAdmin\Controllers\HomeController.cs:line 114

怎么可能是MSDTC?我的交易没有分发

0 个答案:

没有答案