title: Use .NET Async/Await with multiple calls to the same database with Entity Framework 6.0?
body: <p>I'm maintaining an ASP.NET website on .NET 4.7.1 that displays some fairly extensive information using Entity Framework 6.0. Right now, all these DB queries are being performed in serial, so I'm attempting to improve performance by implementing async/await.</p>
  
  <p>The problem I'm having is that running multiple simultaneous queries against the same database seems to be somewhat delicate, and I'm having trouble searching up any best practices for this type of scenario.</p>
  
  <p>The site's initial implementation created a context for each of these queries inside an ambient transaction, and disposed the context after use. Upon converting the whole site to use async (and noting <code>TransactionScopeAsyncFlowOption.Enabled</code>), the page load began throwing exceptions claiming Distributed Transaction Coordinator needed to be configured.</p>
  
  <blockquote>
    <p>System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled.<br>
    Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.</p>
  </blockquote>
  
  <p>Some searching at that point led me to believe that this could be remedied in code without perturbing configuration, so I next redesigned data layer to manage connections in a way that would allow them to share the same context. However, when testing that approach, new exceptions are thrown claiming that the connection is too busy.</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The request failed to run because the batch is aborted, this can be caused by abort signal sent from client, or another request is running in the same session, which makes the session busy.</p>
  </blockquote>
  
  <p>Normally this page's load time is slow (several seconds) but nowhere near the default timeout threshold.</p>
  
  <p>Is async/await best suited only when the queries to run in parallel connect to different databases? If not, is MSDTC the only way to enable this behavior? Or is it perhaps just not a wise thing to blast a single database with so many simultaneous queries?</p>