An error occurred while enlisting in a distributed transaction.

I am trying to wrap some DB calls in a com transaction for testing purposes (make a bunch of calls to the DB, check if they look right, rollback any changes, move on to next test).

So far it works fine running against a local SQL Server, but I can't get it to work against our actual development server.

I have tried messing around with the Security area of DTC settings on both my machine and the server, allowed inbound and outbound connections, enabled network, turned off my firewall etc.

Of course the only message I get when trying to open an ADO.NET connection against our sql server is:

An error occurred while enlisting in a distributed transaction.

This exception is being fired on SqlInternalConnection.EnlistNonNullDistributedTransaction(ITransaction transaction).


The code I am using is as follows:

Dim config As New ServiceConfig
config.Transaction = TransactionOption.RequiresNew
ServiceDomain.Enter(config)

'*** try to access the DB

If ContextUtil.IsInTransaction Then
ContextUtil.SetAbort()
End If
ServiceDomain.Leave()


Can anyone give me any advice as to anything I can check, or probably better would be if there was any way that I can find out more information about why my transaction is not working. I see stuff about tracing but I can't seem to find any of that information. There is nothing in my event viewer.

Any help?

[1475 byte] By [Snkscore] at [2008-2-10]
# 1

Snkscore,

You can start with:

http://blogs.msdn.com/florinlazar/archive/2004/06/18/159127.aspx

I hope it helps,

Florin

FlorinLazar-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 2

Florin,

Thanks for the reply. Unfortunately I had already found your page through my own googeling of my problem.

Do you know any way that I can get any diagnostic info, or some tracing data, or something telling me why the error occurred so I can pinpoint it?

Snkscore at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 3

Next thing to try is to the DTCPing tool: http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx

~Florin

FlorinLazar-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 4

Florin,

Thanks for your help on this...

I tried running the DCTPing tool and I get the following results:

++++++++++++++++++++++++++++++++++++++++++++++
DTCping 1.9 Report for T42
++++++++++++++++++++++++++++++++++++++++++++++
RPC server is ready
++++++++++++Validating Remote Computer Name++++++++++++
03-22, 13:21:16.141-->Start DTC connection test
Name Resolution:
development-->192.168.1.76-->development
03-22, 13:21:16.330-->Start RPC test (T42-->development)
Problem:fail to invoke remote RPC method
Error(0x6D9) at dtcping.cpp @303
-->RPC pinging exception
-->1753(There are no more endpoints available from the endpoint mapper.)
RPC test failed

I tried searching on this error and most people said to turn on Network for the DTC which I have already done, and / or disable firewall, which I have already done.

Any ideas? Thanks.

Snkscore at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 5

You are hitting some RPC errors before you even get to MSDTC.

Here is a KB articles about this RPC error: http://support.microsoft.com/Default.aspx?kbid=839880

I hope this helps.

FlorinLazar-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 6

I have same problem like your's.

I also tried dtctester and dtcping, and getting same error like yours.

Please advise if you already have a solution.

Thanks,

Raj410 at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 7

Did you get a resolution to this? if so, please let me know at sushantanand AT hotmail

Thanks

Inferno at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 8

>> http://support.microsoft.com/Default.aspx?kbid=839880

Is this applicable to XP as well?

HaraldHedlund at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...

Software Development for Windows Vista

Site Classified