none
Web Server 和 Database Server 数据通信问题(The transaction has already been implicitly or explicitly committed or aborted) RRS feed

  • 问题

  • 日志记录:

    2017-03-15 12:31:05.9238 ERROR System.Transactions.TransactionException: The transaction has already been implicitly or explicitly committed or aborted.

    ---> System.Runtime.InteropServices.COMException: The transaction has already been implicitly or explicitly committed or aborted (Exception from HRESULT: 0x8004D00E)   

    at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)   

    at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)   

    --- End of inner exception stack trace ---   

    at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)   

    at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)   

    at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)   

    at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)   

    at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)   

    at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)   

    at System.Data.ProviderBase.DbConnectionPool.PrepareConnection(DbConnection owningObject, DbConnectionInternal obj, Transaction transaction)   

    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)   

    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)   

    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)   

    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)   

    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)   

    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)   

    at System.Data.SqlClient.SqlConnection.Open()   

    at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)   

    at Metro.M1.Data.Archiving.Services.ArchiveService.ExecuteNonQuery(String connectionString, String sql)   

    at Metro.M1.Data.Archiving.ArchiveDatabase.ArchiveExtensions.EnsureTargetTableExist(Archive archive, IArchiveService svc, String tableName, String createTableSql, DateTime minDate)   

    at Metro.M1.Data.Archiving.ArchiveManager.ProcessArchiving(Nullable`1 maxEntryDate, IDataProvider provider, Boolean& hasMoreData)   

    at Metro.M1.Data.Archiving.ArchiveManager.Process()

    • 环境:

              两台server都是 windows server 2012

              IIS 7.0

              SQLSERVER 2014 Enterprise

             .net framework 4.5

    • 其它配置:

             windows DTC component 组件已经启用,不需要授权

             两台服务器的防火墙已禁用

    还有什么原因会导致这个问题呢?


    simple

    2017年3月17日 7:34

全部回复

  • Hi,

    感谢你在MSDN论坛发帖。

    从这个错误信息,应该是你使用的COM组件导致这个问题。

    这个问题是从windows DTC component 组件抛出异常的吗? 如果不使用这个组件,还会抛出异常吗?

    windows DTC component 组件是这个Configure DTC Security组件吗?

    从这个文档中,我们知道DTC组件在默认情况下,是不允许参与电脑远程分布式。

    你可能需要配置这个security。

    Best Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2017年3月20日 3:11
    版主