transactionscope

SQL Server 2000 and System.Transactions.TransactionScope()

Is it possible to create LIGHTWEIGHT transactions using TransactionScope() with SQL2000? Or if not, is there a workaround using CommitableTransaction and/or something similar? So the answer is, basically, "If you want local-to-1-server-transactions on SQL2000, don't use TransactionScope()". ...

TransactionScope Error against Sql Server 2000 - The partner transaction manager has disabled its support for remote/network transactions.

I am trying to set up a simple transaction for my Linq-to-Sql actions against my Sql 2000 database. Using TransactionScope it looks like this: using (TransactionScope transaction = new TransactionScope()) { try { Store.DBDataContext dc = new Store.DBDataContext(); Store.Product product = GetProduct("foo"); dc...

Is this safe? - NUnit base class opens and rollsback a TransactionScope

I was thinking it would be nice to create a base class for NUnit test fixtures that opens a TransactionScope during the SetUp phase, then rolls back the transaction during tear down. Something like this: public abstract class TestFixtureBase { private TransactionScope _transaction; [TestFixtureSetUp] public void TestFixtureSetup...

TransactionScope not rolling back transaction

Here is the current architecture of my transaction scope source code. The third insert throws an .NET exception (Not a SQL Exception) and it is not rolling back the two previous insert statements. What I am doing wrong? EDIT: I removed the try/catch from insert2 and insert3. I also removed the exception handling utility from the ins...

How does TransactionScope roll back transactions?

I'm writing an integration test where I will be inserting a number of objects into a database and then checking to make sure whether my method retrieves those objects. My connection to the database is through NHibernate...and my usual method of creating such a test would be to do the following: NHibernateSession.BeginTransaction(); //...

SharePoint 2007: How can I perform a series of operations within a transaction?

I would love to know how to perform a series of operations in a SharePoint context within a transaction. For example, I would like to be able to do something like the following: context.BeginTransaction(); listItemA.Update(); listItemB.Update(); context.CommitTransaction(); I know this isn't possible with the OOTB APIs, but someone h...

In .Net, can I specify a default application wide Isolation Level?

When I am using a TransactionScope object I can specify the Isoaltion Level using the transaction options. What is the default isolation level used if none is specified? Is it possible to set an application wide default isolation level that would be used by the TransactionScopes? ...

High volumn site using ADO.NET TransactionScope vs ExecuteCommand on NOLOCK, READ UNCOMMITTED directly?

Just read this interesting article by Omar on his blog Linq to SQL solve Transaction deadlock and Query timeout problem using uncommitted reads and at the end Javed Hasan started arguing with him about his solution to the nolock situation on a high volume site. Here, the problem trying to solve is, from the sql sense we need to use Se...

Inner Transactionscope error: "Communication with the underlying transaction manager has failed"

I am not sure I am doing any of this correctly. Is it because I am opening two connections? I am closing them regardless of errors. I did try putting in some inner transaction scopes and setting the second one to RequiresNew. The two methods are independent of each other, however, if one fails I need them both to rollback. I may have to ...

NHibernate with TransactionScope

Can anyone give me a quick overview of using TransactionScope with NHibernate? Do I need to do anything special with the session/IEnlistmentNotification/etc. to get this to work? Are there any pitfalls that I should worry about? For example, can I replace all of my hibernate transactions: var transaction = session.BeginTransaction(); tr...

Nesting transaction scopes for integration tests using Rhino Commons UnitOfWork

I'm trying to set up a integration test class that wraps each test in a transaction. This way I can rollback the transaction after each test instead of resetting the DB before each test. I also want to be able to use transactions in the integration tests themselves. I am using NHibernate and the Rhino Commons UnitOfWork for the the pr...

TransactionScope and Isolation Level

Hello, we have a problem to use TransactionScope. TransactionScope get to us very good flexibility to use transactions across our Data Access Layer. On this way we can use transactions implicit or explicit. There are some performance boost again ADO.NET transactions, but at this time this is not really problem. However we have problem ...

TransactionScope, linq and strange transaction manager issue (HRESULT: 0x8004D024)

I have a service level methods, which make few changes to database and I want them to use transaction control. Such methods can do following: - LINQ SubmitChanges() functionality - Calls to StoredProcedures Component users can combine set of such elementary operations into something bigger. I see that there is nice class TransactinSco...

HRESULT: 0x8004D00E using TransactionScope - C#

I received the following error when I tried to run a C# WinForms application on a Windows Server 2003 Standard Edition SP1 machine that was connecting to a SQL server 2000, converting the data in the WinForms app and inserting the converted into a SQL server 2005 application. I am connecting to each database using SSPI. The code was co...

Trying to understand TransactionScope

I'm trying to make a quick dummy app so I can learn the ins and outs of System.Transactions. This app interacts with 2 different SQLExpress DBs. If I pull up my transaction statistics in component services, I can see a transaction start up in the outerScope when the second connection is opened. If failOuter is true the transaction aborts...

TransactionScope timeout wierdness with TransactionScopeOption.RequiresNew

Ok something ultra strange is going on here... I just added a transaction scope around some legacy code i was debugging to ensure the fiddling I was doing wouldn't get committed. This worked twice, then said: "The transaction manager has disabled its support for remote/network transactions." without any code changes or rebuilds bet...

How do I use TransactionScope in C#?

I am trying to use TransactionScope, but keep getting the exception below. The app is running on a different machine than the database, if that matters. I am using Sql Server 2005. "Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDT...

Why doesn't TransactionScope work with Entity Framework?

See the code below. If I initialize more than one entity context, then I get the following exception on the 2nd set of code only. If I comment out the second set it works. {"The underlying provider failed on Open."} Inner: {"Communication with the underlying transaction manager has failed."} Inner: {"Error HRESULT E_FAIL has been re...

MSMQ Vista x64

I am running Vista Ultimate x64 on my system. I have an application that works fine on a remote server to send messages to the MSMQ instance running on it. When I bring the application to my local system and attempt to send a message it doesn't send, but doesn't error out either. I even tried setting up a local MSMQ instance and the same...

new System.Transactions.TransactionScope() on background thread halts program

I have some code using a System.Transactions.TransactionScope, that creating a new instance of the transaction scope simply halts the program. There are no exceptions or messages, the program simply stops and Visual Studio returns to code editing mode. The process is completely gone. There are no exceptions, messages or events in the ...