views:

39

answers:

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?

+1  A: 

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.

Mauricio Scheffer