Distributed Transactions Configuration Problems

I'm having a heck of a time getting DT configured and working in my .NET app.  Got a page that calls the DB and inserts/updates/deletes a bunch of data.  Needless to say, I want to roll it all back if anything goes wrong.

Here is a STRIPPED down version of what I'm doing:

Using ts As New TransactionScope()

	Try
		Using objConn2 As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("strConn1"))
			Using oCom2 As SqlCommand = New SqlCommand
			
				Call Stored Procedure
						
			End Using
		End Using


		Using objConn2 As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("strConn1"))
			Using oCom2 As SqlCommand = New SqlCommand
				
				Call Second Stored Procedure

			End Using
		End Using

		Call Third and Fourth SP
			DeleteDemographic(CInt(IndividualID), rbCombined.SelectedValue)
			InsertDemographic(CInt(IndividualID), rbCombined.SelectedValue)

		More SP's
			DeleteDemographic(CInt(IndividualID), rbAge.SelectedValue)
			InsertDemographic(CInt(IndividualID), rbAge.SelectedValue)

		More SP's
			DeleteDemographic(CInt(IndividualID), rbVacationing.SelectedValue)
			InsertDemographic(CInt(IndividualID), rbVacationing.SelectedValue)

		Using objConn4 As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("strConn1"))
			Using oCom4 As SqlCommand = New SqlCommand
					
				Last Stored Procedure

				End Using
			End Using

	ts.Complete()

	Catch ex As Exception
		Response.Write(ex.Message)
		ts.Dispose()

	End Try
End Using

Open in new window


I first was getting an error about DTC not being configured correctly.  I went on both the Web Server (client) and Database Server (server) and configured the MSDTC in Component Services.

That error went away and was replace with this
Communication with the underlying transaction manager has failed.

I'd prefer not to give up on this and put it into production with this Error Handling.  It probably won't do tons of harm to the data but it will still not be great it some data goes in while some doesn't update or delete, etc.

Thanks
cat4larryAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel_PLDB Expert/ArchitectCommented:
Hi,
It would be much help if you post this error stack trace here.
0
cat4larryAuthor Commented:
Sorry for the delay.  Here's the exception message, stack trace and inner exception:

Communication with the underlying transaction manager has failed.

at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx) at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx) at System.Transactions.EnlistableStates.Promote(InternalTransaction tx) at System.Transactions.Transaction.Promote() at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction) at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at InsertOfferSaleFtF.btnSubmit_Click(Object sender, EventArgs e) in C:\Users\David\Documents\Projects\BrandTango\Tango\TangoBerkleyV2\InsertOfferSaleFtF.aspx.vb:line 775

The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)

at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim) at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
0
cat4larryAuthor Commented:
My environment is:

a Dev machine on my local machine with a SQL Server 2005 Backend on a server outside my local network (I reach it by IP Address).

Based on the message, I'm guessing the "various sides" can't communicate with each other.  I'm going to try running the code in staging, where the Server Code and the DB are on servers in the same network.  I'm also going to try running on a machine where the server and db are on the SAME machine.
0
Daniel_PLDB Expert/ArchitectCommented:
Hi,

Error 0x8004D02B states that MSDTC was unreachable on the other machine.  iIt may be NetBIOS resolution or firewall or MSDTC security settings.

You wrote that you are using ip address to connect to SQL Server, to use MSDTC you need working NETBIOS resolution :)

In addition please examine following links, in case of any further questions please post here :)

Debugging distributed transactions msdtc network problems

http://support.microsoft.com/kb/918331/en-us

http://sysadminwebsite.wordpress.com/2012/05/29/9/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.