0
votes

I am using entity provider & sqlclient provider targeting same sql server in a single transaction scope. I am getting below error:

Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.

I dont want to escalate to msdtc as only one sql server is being used. Please suggest.

1

1 Answers

0
votes

A distributed transaction is required if more than one SqlConnection is used, regardless of the number of servers and databases. This is because each connection has its own SQL session that can be independently committed and rolled back. If you have more than one connection then a distributed transaction coordinator is needed to coordinate the two separate transactions.

If you don't want to escalate then you can only use one connection in the transaction.