user1257043
user1257043

Reputation:

C#, Linq2Sql, TransactionScope, "Transaction has aborted.", msdtc, sqlserver 2005

we're having issues with TransactionScope in a .NET 4 project.

We have segmented our DAL's into domains, that is we have different Linq2Sql DataContexts pointing to the same database.

The issue arises when, within the same TransactionScope, we insert/update on more than one DataContext, instantly a msdtc transaction will pop up, both locally and on the server, and then it will just hang there for 1-2 minutes (guess it times out), the code will then continue to run, until t.Complete() and subsequent implied .Dispose will yield and Exception "Transaction has aborted.".

We have configured msdtc both locally and on the server to allow all, no authentication, full trace levels, still no relevant information comes from the dtctrace.log

I guess it is standard procedure for msdtc to kick in when more that one database connection is initiated (even if it is vs. the same database), but why the timeout? The operations are not conflicting, there is no possible way for a deadlock to occur in our domain?

Have googled and tested extensively, hope for some seasoned experience here :)

Upvotes: 0

Views: 760

Answers (1)

Anders Abel
Anders Abel

Reputation: 69250

With SQL2005 any transaction spanning multiple connections will be escalated to DTC. With SQL2008, several connections with the same connection string can participate in the same transaction without the need for DTC. With the architecture you've chosen I'd strongly suggest upgrading to SQL2008 if that is an option. DTC can be a paint to get working correctly.

Upvotes: 1

Related Questions