サーバー #1 に Web サービスがあり、サーバー #2 にデータベースがあります。Web サービスは、トランザクション スコープを使用して分散トランザクションを生成します。すべてが正しいです。
そして、サーバー #3 に別のデータベースがあります。このサーバーに問題があり、オペレーティング システムとソフトウェアを再インストールしました。MSDTC を構成し、サーバー #1 の Web サービスを使用して、このサーバー上のデータベースと通信しようとしました。そして、トランザクション スコープ内の最初の select ステートメントの後、次のようになりますThe operation is not valid for the state of the transaction
。この例外は、トランザクション スコープを使用している場合、すべての Web サービス リクエストに当てはまります。サーバー #2 とサーバー #3 はほぼ同じです。違いは設定だけです。.NET Framework 3.5 SP1 がインストールされ、すべてのサーバーに SQL Server SP3 がインストールされています。
完全なスタック トレース:
System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction) в System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) в System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction t в System.Data.SqlClient.SqlInternalConnection .Enlist(Transaction t × System.Data.SqlClient.SqlInternalConnectionTds.Activate(トランザクション トランザクション) × System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(トランザクション トランザクション) × System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) × System. Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) в システム。Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) v System.Data.SqlClient.SqlConnection.Open() v NHibernate.Connection.DriverConnectionProvider.GetConnection() v NHibernate.Impl.SessionFactoryImpl.OpenConnection()
このメッセージを検索しましたが、適切な解決策が見つかりませんでした。では、どの設定を確認する必要があり、それを修正するには正確に何をすればよいでしょうか?