Does TransactionScope Need DTC Service on?

后端 未结 2 1150
無奈伤痛
無奈伤痛 2021-02-05 23:21

From what I\'m reading, in order to use TransactionScope in .NET, you need the Distributed Transaction Coordinator service in Windows to be running. I have that service

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-06 00:03

    MSDTC comes into the play only if you have more than one transaction with different connections

    SO, the answer is:

    It depends!

    • If you use 1 TranScope per 1 connection - then NO
    • If you use 1 TranScope per more than 1 connection - then YES
    • If you created TransactionScope object which requires Distributed transaction - then YES

提交回复
热议问题