EnterpriseService Component: problem enlisting in a distributed transaction

  • Thread starter Thread starter Don Riesbeck Jr.
  • Start date Start date
D

Don Riesbeck Jr.

I have an C# EnterpriseService component that is part of an application I am
developing that is responsible for writing data to an SQL Server. (it reads
from a local DB (MSDE), then writes to a 'remote' DB (SQL Server 2k)...) On
some machines I get the following exception:

System.InvalidOperationException: An error occurred while enlisting in a
distributed transaction.
at
System.Data.SqlClient.SqlInternalConnection.EnlistNonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activate(Boolean
isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at [The method making the call]

More Info:
- The problem host machines are running Windows 2000 Pro, and the remote
machines are running Win2k Pro, or Server. I get the same exception
regardless of the server machine OS (pro or server) and I have another Win2k
Pro machine working fine.
- The ES Component is set to Require transactions. (it works if we set
transactions to disabled, but we need the transactions)
- One of the problem host machines it behind a NAT router, and is not on the
domain with the remote sql server. (This should work...)
- The other problem host machine is on the same domain.
- When either of the host machines is setup as a server machine (meaning
that it is pointed to as a remote DB) it does NOT work, I get the same
exception from the other end.


Thanks in advance,
Don Riesbeck Jr.
 
Don said:
System.InvalidOperationException: An error occurred while enlisting in a
distributed transaction.
at
System.Data.SqlClient.SqlInternalConnection.EnlistNonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activate(Boolean
isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at [The method making the call]

Make sure that the DTC service is running when you try to do this.
 
Aaron Weiker said:
Don said:
System.InvalidOperationException: An error occurred while enlisting in a
distributed transaction.
at
System.Data.SqlClient.SqlInternalConnection.EnlistNonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activate(Boolean
isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at [The method making the call]

Make sure that the DTC service is running when you try to do this.

That was the first think I checked.

Thanks
 
Check that every machine has MS DTC (Microsoft Distributed Transaction
coordinator) installed and the service has started.


AMB
 
I should probably state that Both SQL Server and MSDTC are installed and
started on ALL machines.
 
surely if the remote SQL Server is not on the same domain you are going to
have to setup a trust relationship between the 2 boxes

HTH

Ollie Riches
 
Don,

If you right click on the computer icon in Component Services, you
should be able to get the property pages for the machine. One of the tabs
is MSDTC. There is a button for security settings on that machine. I
believe you have to make sure that the machine can allow incoming
transactions to be flowed through the system.

XP SP2 automatically shuts these off for you, so that you can't enlist
in distributed transactions. I believe the recent SP for W2K does this as
well. That is the first thing I would check though.

Hope this helps.
 
Nicholas,

I looked under the Component Services -> My Computer Properties, but I don't
see a security button under the MSDTC tab just a coordinator section, log,
protocol config, and a service control section. There is a Default Security
tab which I added 'EVERYONE' too for both access, and launch. But that
didn't fix the problem, I still get the same exception.

We havn't seen this problem with Windows 2k server, is there any significant
(in the context of transactions) between Server and Pro?

Thanks,
Don

Nicholas Paldino said:
Don,

If you right click on the computer icon in Component Services, you
should be able to get the property pages for the machine. One of the tabs
is MSDTC. There is a button for security settings on that machine. I
believe you have to make sure that the machine can allow incoming
transactions to be flowed through the system.

XP SP2 automatically shuts these off for you, so that you can't enlist
in distributed transactions. I believe the recent SP for W2K does this as
well. That is the first thing I would check though.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I have an C# EnterpriseService component that is part of an application I
am
developing that is responsible for writing data to an SQL Server. (it
reads
from a local DB (MSDE), then writes to a 'remote' DB (SQL Server 2k)...)
On
some machines I get the following exception:

System.InvalidOperationException: An error occurred while enlisting in a
distributed transaction.
at
System.Data.SqlClient.SqlInternalConnection.EnlistNonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activate(Boolean
isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at [The method making the call]

More Info:
- The problem host machines are running Windows 2000 Pro, and the remote
machines are running Win2k Pro, or Server. I get the same exception
regardless of the server machine OS (pro or server) and I have another
Win2k
Pro machine working fine.
- The ES Component is set to Require transactions. (it works if we set
transactions to disabled, but we need the transactions)
- One of the problem host machines it behind a NAT router, and is not on
the
domain with the remote sql server. (This should work...)
- The other problem host machine is on the same domain.
- When either of the host machines is setup as a server machine (meaning
that it is pointed to as a remote DB) it does NOT work, I get the same
exception from the other end.


Thanks in advance,
Don Riesbeck Jr.
 
I have abut the same problem. it works on 4 machines (XP pro + SP2),
and it doesn't work on other 3 machines. On one of them it gives a
security error, on another one it gives a "Error enlisting in
distributed....". I tryed everything that I could find on the net, no
luck.
One 3rd bad machine (W2003) is not on the same domain. How do I create
a trust relation ship between them?
thanks,
florin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top