HRESULT: 0x8004D00E using TransactionScope - C#

3

I received the following error when I tried to run a C# WinForms application on a Windows Server 2003 Standard Edition SP1 machine that was connecting to a SQL server 2000, converting the data in the WinForms app and inserting the converted into a SQL server 2005 application. I am connecting to each database using SSPI.

The code was contained within a TransactionScope block:

System.TimeSpan TransactionTimeOut = new TimeSpan(0, 40, 0);

    using(TransactionScope Scope = new TransactionScope(TransactionScopeOption.RequiresNew, TransactionTimeOut))
    {
        try
        {
            //meat of transaction...
        }
        catch(Exception ex)
        {
            throw ex;
        }

        Scope.Complete();
    }

Error Messages:

Exception: The transaction has already been implicitly or explicitly committed or aborted.

Inner Exception: The transaction has already been implicitly or explicitly committed or aborted (Exception from HRESULT: 0x8004D00E)

Any one know what might be causing this issue?

c#
.net
sql-server-2005
sql-server-2000
transactionscope
asked on Stack Overflow Apr 23, 2009 by Michael Kniskern • edited Apr 24, 2009 by Michael Kniskern

2 Answers

5

Check that the DTC is started on the machine where your code is running. Since you are using 2 connections in the transactionscope, the transaction will be promoted to a DTC based transaction.

Also, check that the security is configured correctly (check this by allowing anonymous participation in the DTC transaction), and that your firewall is allowing the DTC through it.

Check out this forum FAQ: Distributed Transaction Coordinator(MSDTC) and Transaction FAQ

[Related to this SO question: Distributed Transaction Coordinator]

answered on Stack Overflow Apr 24, 2009 by Mitch Wheat • edited May 23, 2017 by Community
0

How long is this process taking? If you hit your timeout (unlikely with a 40 minute timeout, but still possible), you could receive that error message.

Otherwise, are you receiving the exception? What is occurring before the exception is thrown?

answered on Stack Overflow Apr 24, 2009 by Reed Copsey

User contributions licensed under CC BY-SA 3.0