in our current project, we use the ADO.NET Entity Framework as the data layer for the application. There are several tasks that require a transaction because there is a lot of work in the database. I use TransactionScope to combine these tasks.
using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew))
{
transactionScope.Complete();
}
The problem is that when I use TransactionScope , an exception is thrown:
Fix System.Data.EntityException: The underlying provider does not work in Open. ---> System.Transactions.TransactionManagerCommunicationException: Communication with the main transaction manager failed. ---> System.Runtime.InteropServices.COMException (0x80004005): HRESULT error E_FAIL was returned from a call to the COM component.
It seems that this error should do something with MSDTC (Microsoft Distributed Transaction Coordinator). When I change the MSDTC security configuration, another exception is thrown:
System.Data.EntityException: Open. --- > System.Transactions.TransactionManagerCommunicationException: Distributed Transaction Manager (MSDTC) . DTC MSDTC .
MSDTC , TransactionScope .
- , ?