locked
Transaction Promotion from Lightweight to Distributed for Debug Configuration RRS feed

  • Question

  • I have a .Net 4 application using TransactionScope and I am trying to determine why .Net is promoting the transaction from a lightweight transaction to a distributed transaction when I run the application in DEBUG mode on my Windows 7 development machine.  If I build and run the application in RELEASE mode then the transaction completes fine using the LTM.  However, as soon as I build and run in DEBUG mode then I receive the error message: "The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)".

    The error is resolved if I configure DTC to allow Network Access.  My question is why does DTC need to be configured this way to run the application in DEBUG mode?

    The transaction that I am attempting to run is pretty straight forward:

    Using trans As TransactionScope = New TransactionScope()
       Using conn As SqlConnection = New SqlConnection(...)
          INSERT INTO TABLE (col1, col2) VALUES (@col1, @col2);
          ...

    Thank you.

     

     

     


    Bradley Wells - LocalJobNetwork.com
    • Moved by T.J. --- MSFT Friday, July 29, 2011 9:04 PM I believe this is a SqlClient issue. (From:Transactions Programming)
    Thursday, July 7, 2011 8:14 PM

All replies

  • I've take a look at this, and as far as I can tell, there's no code in the Transactions stack that behaves differently between RELEASE and DEBUG modes.  For that reason I suspect it may be something in System.Data that's causing the inadvertent promotion.  I'm going to move this thread to that forum in hopes someone over there knows.
    Friday, July 29, 2011 9:04 PM
  • Do you open any other connections inside the transaction? (If possible, can you please post all of the code inside the transaction scope)

    Thursday, September 29, 2011 12:32 AM