473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

EnterpriseService Component: problem enlisting in a distributed transaction

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.Enlist NonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activa te(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.
Nov 16 '05 #1
8 4340
Don Riesbeck Jr. wrote:
System.InvalidOperationException: An error occurred while enlisting in a
distributed transaction.
at
System.Data.SqlClient.SqlInternalConnection.Enlist NonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activa te(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
http://aaronweiker.com/
http://www.sqlprogrammer.org/
Nov 16 '05 #2

"Aaron Weiker" <aa***@sqlprogrammer.org> wrote in message
news:ew**************@TK2MSFTNGP09.phx.gbl...
Don Riesbeck Jr. wrote:
System.InvalidOperationException: An error occurred while enlisting in a
distributed transaction.
at
System.Data.SqlClient.SqlInternalConnection.Enlist NonNullDistributedTransact ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction() at System.Data.SqlClient.SqlInternalConnection.Activa te(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
http://aaronweiker.com/
http://www.sqlprogrammer.org/


That was the first think I checked.

Thanks
Nov 16 '05 #3
Check that every machine has MS DTC (Microsoft Distributed Transaction
coordinator) installed and the service has started.
AMB

"Don Riesbeck Jr." wrote:
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.Enlist NonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activa te(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.

Nov 16 '05 #4
I should probably state that Both SQL Server and MSDTC are installed and
started on ALL machines.

"Don Riesbeck Jr." <02********************@nerdlycrap.com> wrote in message
news:e6**************@TK2MSFTNGP14.phx.gbl...
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.Enlist NonNullDistributedTransact ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activa te(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.

Nov 16 '05 #5
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 Riesbeck Jr." <02********************@nerdlycrap.com> wrote in message
news:e6**************@TK2MSFTNGP14.phx.gbl...
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.Enlist NonNullDistributedTransact ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activa te(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.

Nov 16 '05 #6
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]
- mv*@spam.guard.caspershouse.com
"Don Riesbeck Jr." <02********************@nerdlycrap.com> wrote in message
news:e6**************@TK2MSFTNGP14.phx.gbl...
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.Enlist NonNullDistributedTransact
ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr
ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction()
at System.Data.SqlClient.SqlInternalConnection.Activa te(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.

Nov 16 '05 #7
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:un**************@TK2MSFTNGP14.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com
"Don Riesbeck Jr." <02********************@nerdlycrap.com> wrote in message news:e6**************@TK2MSFTNGP14.phx.gbl...
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.Enlist NonNullDistributedTransact ion(ITransaction transaction)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction(ITr ansaction newTransaction, Guid newTransactionGuid)
at
System.Data.SqlClient.SqlInternalConnection.Enlist DistributedTransaction() at System.Data.SqlClient.SqlInternalConnection.Activa te(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.


Nov 16 '05 #8
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
Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve Thorpe | last post by:
Hi have have two linked SQL Servers and I am trying to get things working smootly/quickly. Should I be using 'BEGIN TRANSACTION' or 'BEGIN DISTRIBUTED TRANSACTION' ? Basicly, these SPs update...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
2
by: Jo Siffert | last post by:
Hi all, I would like to perform an INSERT INTO LINKEDSVR.dbo.xyz.abc SELECT ... FROM dbo.dfg where LINKEDSVR is a linked server on another machine. Both servers are running SQLServer 2000...
0
by: Benjamin | last post by:
Hi! (Maybe this is not the optional Managed Newsgroup for this issue...?) We have problems after upgrading to Windows XP SP2 on our development machines. We have tried to follow the...
2
by: John Lee | last post by:
Hi, I have few questions related to .NET 2.0 TransactionScope class behavior: 1. Check Transaction.Current.TransactionInformation.DistributedIdentifier to identify if distributed transaction...
0
by: gshawn3 | last post by:
Hi, I am having a hard time creating a Trigger to update an Oracle database. I am using a SQL Server 2005 Express database on a Win XP Pro SP2 desktop, linked to an Oracle 10g database on a...
0
by: na | last post by:
My ASP.Net 2.0 web site has a Data.xsd schema. I just added a table adapter to the collection and configured it to use an existing SQL 2000 stored proc. When I tried to preview data from the...
2
by: rbg | last post by:
Hi, On My local SQL server I have added a linked server to another SQL server (remoteserver) in another Windows NT Domain. When I run this code select count(*) from...
6
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, In asp.net, there is an object sqltransaction we can use to garantee the data will be written to database either completely or none will be written into database. I am not sure if there...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.