Is it possible to use .NET TransactionScope with Sql Server 2005 without the possibility of promoting DTC?

I am dealing with some pain on the ass servers, and I would like them to just use transactions without the DTC (now I can concentrate elsewhere). I use several databases within the scope, so the typical behavior is promotion, but I want to avoid this. What will be the behavior in case of doubtful transaction on this model, if possible? I assume tx.Complete () will throw?

The reason for this is because I get these random errors (feel free to answer the question why for this too, if you can help, this is SPORADIC, not a constant):

System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.

   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.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)

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

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

   at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)

   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()
+3
5

, , , DTC, , .

+4

TransactionScope DTC. :

  • , .
  • ( , ...)

"" , - , . , .

+1

DTC ( ) - SQL Server 2008 .Net 3.0.

+1

, 4 , , DTC.

, , MSDTC ( , ) Transactions , , MSDTC .

( TON )... MSDTC ( ), . . .

[EDIT:] , , MSDTC, .

0

MultipleActiveResultSets

0

Source: https://habr.com/ru/post/1725089/


All Articles