I've been writing unit tests with NUnit, and using System.Transactions to undo my modifications to the database. It works really well when I run a small number of tests (5-10) at the same time. When click on the top node of my unit test tree in NUnit and run all my tests(100+), I get a handful of failures. If those tests are run as part of a smaller set, they complete fine. The error message is always the same....
EPAS.BusinessObjects.UnitTests.FormTestFixtures.CommentQuestionFixture.InsertCommentQuestion : Csla.DataPortalException : DataPortal.Update failed
----> Csla.Server.CallMethodException : DataPortal_Update method call failed
----> System.Data.SqlClient.SqlException : New request is not allowed to start because it should come with valid transaction descriptor.
I've applied the hotfix that looks like it should solve this problem, but it's still there.
http://support.microsoft.com/kb/916002
Anyone have any ideas?
Jeff
UnitTest Sample....
<SetUp()> _
Public Sub Setup()_scope =
New TransactionScope(TransactionScopeOption.RequiresNew)_form = InsertForm()
_formID = _form.FormID
End Sub<TearDown()> _
Public Sub TearDown()_scope.Dispose()
End SubI never did find an answer. I still feel like it is a bug in System.Transactions, but I don't have any hard evidence to support that. I was able to find a few references to similar problems posted on Microsoft's various sites. In the end, I had to stop searching because of other priorities.
Jeff
Copyright (c) Marimer LLC