1

I am having several issues while using a WCF which uses an Entity Framework solution to connect to the database..If for example many requests come from the same user for the same transactional method, TransactionScope elevates the transaction to Distributed.

My problem is that I am using Azure and distributed transactions are not allowed in SQL Azure.

I believe that the TransactionScope object does not get disposed fast enough and so it overlaps but I am not sure.

Any help?

  • See http://stackoverflow.com/questions/3187632/transactionscope-avoiding-distributed-transactions and http://stackoverflow.com/questions/1690892/transactionscope-automatically-escalating-to-msdtc-on-some-machines. It sounds like those will answer your question, but if not, consider adding more detail to your question. – Tim M. May 10 '13 at 20:38
  • 1
    With EntityFramework, assuming you're hitting a single database (with identical connectionstrings), then you're likely having multiple simultaneously-open connections that cause it to try to step up to a distributed transaction. The key is that you can only have 1 live connection at a time to the database in a transaction. If you have added retry logic to your DAL with EntityFramework, chances are that you now hold open connections to be less chatty and that will be a major source of this problem. – Jaxidian May 10 '13 at 20:47
  • Only one connection per Ip or one connection by object? – Bryan Arbelo - MaG3Stican May 16 '13 at 19:13

1 Answers1

1

Quick update on distributed transactions with Azure SQL Database: A couple of days ago, we introduced support for distributed transactions in Azure SQL Database. The feature that lights up the capability is called elastic database transactions. It focuses on scenarios using the .NET distributed transaction APIs such as TransactionScope. These APIs start working against Azure SQL Database once you installed the new 4.6.1 release of the .NET framework. You can find more information about how to get started here: https://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic-transactions-overview/.

Please give it a try!

Thanks, Torsten

Torsten Grabs
  • 481
  • 1
  • 3
  • 5