1

Do we have to have to enable MSDTC to use TransactionScope?

I am using TransactionScope and I had error message telling me that the MSDTC not enabled. So I have enabled it.

Why am I having this error message? Is that normal? What`s MSDTC use?

Is transactionScope SQLSecver specific?

learning
  • 11,415
  • 35
  • 87
  • 154
  • 1
    Before someone posting a 500 words answer here, why do you want to use transactionscope? – Paco Sep 28 '10 at 13:55
  • I am using transaction scope as I am having nested transactions and NHIbernate doesn`t seem to support nested transactions. – learning Sep 29 '10 at 05:14

1 Answers1

1

TransactionScope will treat your transaction as distributed if you use more than one connection within the same scope, therefore requiring MSDTC to be enabled. See this question for more information on TransactionScope.

Generally, if you don't need distributed transactions, you can just use NHibernate's ITransactions instead. Take a look at the NHibernate reference documentation for lots of examples of NHibernate transactions.

Community
  • 1
  • 1
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275