Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« I'm looking for a great DBA! | Main | I'm looking for a great tester to work with me »
Saturday
Nov252006

Solving "An error occurred while enlisting in a distributed transaction" error when using Rollback Attribute or COM+ in unit tests

One of the things I'm most proud of creating is XtUnit, which allows Rolling back the effects of a unit test against a database. (which really means its an integration test - maybe we should call these hybrids "coded tests"?)

MbUnit added the same attribute to its core attribute set and now people are starting to get weird errors sometimes when using the rollback attribute:

"An error occurred while enlisting in a distributed transaction"

Steven Harman has a good explanation of what you should do when you get this error.

"This attribute works by enlisting a COM+ 1.5 transaction from the local Distributed Transaction Coordinator (DTC). This in and of itself is not an issue, but it does cause problems when the db you're trying to access sits on a remote server, as in my case. The COM+ 1.5 transaction attempts to use Transaction Internet Protocol (TIP) to access the remote SQL server. The problem is that Win2k3 Server & WinXP Pro SP2 both disable TIP by default.

The solution: Enable & Configure TIP on BOTH the remote server and the local dev box. Here's how:"

Read the exact steps here.

[via Andrew]

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>