Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8521947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:58:11+00:00 2026-06-11T06:58:11+00:00

Background I have both an MVC app and a windows service that access the

  • 0

Background

I have both an MVC app and a windows service that access the same data access library which utilizes EntityFramework. The windows service monitors certain activity on several tables and performs some calculations.

We are using the DAL project against several hundred databases, generating the connection string for the context at runtime.

We have a number of functions (both stored procedures and .NET methods which call on EF entities) which because of the scope of data we are using are VERY db intensive which have the potential to block one another.

The problem

The windows service is not so important that it can’t wait. If something must be blocked, the windows service can. Earlier I found a number of SO questions that stated that System.Transactions is the way to go when setting your transaction isolation level to READ UNCOMMITTED to minimize locks.

I tried this, and I may be misunderstanding what is going on, so I need some clarification.

The method in the windows service is structured like so:

private bool _stopMe = false;

public void Update()
{
    EntContext context = new EntContext();
    do
    {
        var transactionOptions = new System.Transactions.TransactionOptions();
        transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;
        using (var transactionScope = new System.Transactions.TransactionScope( System.Transactions.TransactionScopeOption.Required, transactionOptions))
        {
            List<Ent1> myEnts = (from e....Complicated query here).ToList();
            SomeCalculations(myEnts);
            List<Ent2> myOtherEnts = (from e... Complicated query using entities from previous query here).ToList();
            MakeSomeChanges(myOtherEnts);
            context.SaveChanges();
        }
        Thread.Sleep(5000);  //wait 5 seconds before allow do block to continue
    }while (! _stopMe)
}

When I execute my second query, an exception gets thrown:

The underlying provider failed on Open.
    Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please
    enable DTC for network access in the security configuration for MSDTC using the
    Component Services Administrative tool.
        The transaction manager has disabled its support for remote/network
        transactions. (Exception from HRESULT: 0x8004D024)

I can assume that I should not be calling more than one query in that using block? The first query returned just fine. This is being performed on one database at a time (really other instances are being run in different threads and nothing from this thread touches the others).

My question is, is this how it should be used or is there more to this that I should know?

Of Note: This is a monitoring function, so it must be run repeatedly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:58:13+00:00Added an answer on June 11, 2026 at 6:58 am

    In your code you are using transaction scope. It looks like the first query uses a light weight db transaction. When the second query comes the transaction scope upgrades the transaction to a distributed transaction.

    The distributed transaction uses MSDTC.

    Here is where the error comes, by default MSDTC is not enabled. Even if it is enabled and started, it needs to be configured to allow a remote client to create a distributed transaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background, Part 1 I have a form that collects both frequency and duration from
I have an app that needs backgrounds for both parts of the split view.
I have an ASP.NET MVC 3 (.NET 4) web application. This app fetches data
Background: i have a system, i use the same for both hobby and office
Background: We have two directories of Crystal Reports for both the web side of
I have background music for some songs available in both .MID and .KAR formats,
Background: I have an MVC based polaroid object. The model keeps the photo's metadata,
Background I have two lists, the first is items which contains around 250 tuples,
Background I have a function that takes a config object as an argument. Within
Background : I have a few different threads which each need to write to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.