MSDTC 分布式事务错误:[COMException (0x8004d00e): 此事务已明地或暗地被确认或终止 (异常来自 HRESULT:0x8004D00E)]
// 堆栈信息
[COMException (0x8004d00e): 此事务已明地或暗地被确认或终止 (异常来自 HRESULT:0x8004D00E)]
System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer) +0
System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts) +237
[TransactionException: 事务已被隐式或显式提交,或已终止。]
System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException) +412
System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts) +292
System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) +527
System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx) +801124
System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction) +795031
System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) +30
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1205
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
Enhua.RS.SQLServerDAL.TemplateDb.DeleteTemplate(Int32 templateId) in E:\NHRS\NHRSWeb\SQLServerDAL\TemplateDb.cs:248 // 异常起点,在这里 !!!!!
// 出错代码
// 以上省略若干 TranactionScope 详细声明
foreach (DataRow r in rows) {
行 247: using (SqlConnection conn = new SqlConnection(r[ "ConnectionString "].ToString())) {
行 248: conn.Open(); // Open 的时候就丢出异常了!!!!!
行 249: SqlCommand cmd = conn.CreateCommand();
行 250: foreach (DataRow jrow in dsTpl.Tables[0].Rows) {
// 环境
IIS 与 SQL 同一台服务器没有问题,
【不同服务器】就出问题了
两台服务器均是 win 2k3 sp2,
之前 sp1 是可以正常访问的,刚打 SP2 就遭