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 8541877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:55:48+00:00 2026-06-11T11:55:48+00:00

I have reduced a problem I’m having to the following example code: var inQueue

  • 0

I have reduced a problem I’m having to the following example code:

var inQueue = ".\private$\testqueue";
using (var ts = new TransactionScope())
{
    using (var q = new MessageQueue(inQueue, QueueAccessMode.Send))
    {
        for (var i = 0; i < 100000; ++i)
        {
            var msg = new Message(i);
            q.Send(msg, MessageQueueTransactionType.Automatic);
        }
    }
    ts.Complete();
}

As you can see, all it does it write 100,000 integers to a (transactional, local) queue using the TransactionScope pattern. My understanding is that this type of operation would not escalate to a DTC transaction.

However, if I open up Component Services while this is running, I can see the transaction in the Local DTC > Transaction List. This means that the transaction has been escalated, right?

Why would this be happening? I was prompted to this by bad performance in another program, and it would appear that the use of DTC for such a simple transaction may be a factor. Regardless, I just want to understand the cause.

Any help would be appreciated.

  • 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-11T11:55:49+00:00Added an answer on June 11, 2026 at 11:55 am

    From http://geekswithblogs.net/dotnetrodent/archive/2008/04/16/121279.aspx

    If you only need to do transactional work related to message queues,
    without any other resources that need to be in the transactional
    context (like databases), don’t use the TransactionScope, but rather
    the MessageQueueTransaction class. Using this
    class to control transactions related only to message queues comes
    with a lesser performance penalty than using a full distributed
    transaction controlled by DTC.

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

Sidebar

Related Questions

I've reduced my problem (table layout algorithm) to the following problem: Imagine I have
I have reduced the problem to the following basic function which should simply print
The problem we have is reduced to the following two statements: select convert(float, (convert(float,5741.61)/convert(float,
I have a problem with auto_ptr in Exception classes, that I eventually reduced to:
I have the following form, which I have reduced as much as I can,
I have the following record (reduced for brevity): [DelimitedRecord(,)] [IgnoreFirst] [IgnoreEmptyLines()] public class ImportRecord
I have a problem at hand which can be reduced to something like this
I am using twitter bootstrap but have a problem with the nav bar height
I have been using Apache on my local LAN. The problem is that i
I have some performance-heavy code that performs bit manipulations. It can be reduced 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.