transactionscope

Informix .NET Provider and TransactionScope not rolling back

I have a little proof-of-concept distributed transaction application that is doing a simple insert into two tables -- one a MS SQL Server table, the other an Informix Dynamic Server table. The problem comes when an exception is thrown. If I use the OLE DB driver for Informix, everything works fine -- both inserts roll back; if I use the ...

Informix, NHibernate, TransactionScope interaction difficulties

I have a small program that is trying to wrap an NHibernate insert into an Informix database in a TransactionScope object using the Informix .NET Provider. I am getting the error specified below. The code without the TransactionScope object works -- including when the insert is wrapped in an NHibernate session transaction. Any ideas on w...

TransactionScope in a medium trust

Im running an ASP.NET MVC application hosted with Mosso, there are telling me that they cannot enable DTC because they run everything in medium trust. So when executing code that references: TransactionScope I get the following error. The transaction manager has disabled its support for remote/network transactions. (Exception from HRESU...

TransactionScope helper that exhausts connection pool without fail - help?

A while back I asked a question about TransactionScope escalating to MSDTC when I wasn't expecting it to. (Previous question) What it boiled down to was, in SQL2005, in order to use a TransactionScope, you can only instance and open a single SqlConnection within the life of the TransactionScope. With SQL2008, you can instance multiple ...

C# - System.Transactions.TransactionScope

I was curious about the TransactionScope class. For the most part, I assume it was intended for database connections (which is what I've used it for). My question, is can you put any code in the using-block of a TransactionScope to make it transactional? MS documentation is not clear on this. If it can be used to make code other than...

TransactionScope With Files In C#

I've been using TransactionScope to work with the database and it feels nice. What I'm looking for is the following: using(var scope=new TransactionScope()) { // Do something with a few files... scope.Complete(); } but obviously this doesn't work -- if there are 20 files, and an exception occurs on the 9th file,...

TransactionScope problem with Message queues

I'm facing the next problem. I have a piece of code that goes like this: DoSomething(){ using (TransactionScope scope = new TransactionScope()) { InsertSomething(); InsertSomethingElse(); InsertYetAnotherThing(); ProcessDataRelatedWithThePreviousInserts(); scope.Complete() } } In ProcessDataRela...

C# TransactionScope - L2E

Is it worth using System.Transactions.TransactionScope on Linq to Entities? On the MS documentation, it says that SQL calls within ObjectContext.SaveChanges() are all rolled into one transaction internally. We have 1 database connection, that is a local SQLite database on the file system. We just want to make sure all our operations t...

How does TransactionScope guarantee data integrity across multiple databases?

Hey guys, Can someone tell me the principle of how TransactionScope guarantees data integrity across multiple databases? I imagine it first sends the commands to the databases and then waits for the databases to respond before sending them a message to apply the command sent earlier. However when execution is stopped abruptly when sendi...

TransactionScope and Connection Pooling

Hi, I'm trying to get a handle on whether we have a problem in our application with database connections using incorrect IsolationLevels. Our application is a .Net 3.5 database app using SQL Server 2005. I've discovered that the IsolationLevel of connections are not reset when they are returned to the connection pool (see here) and ...

TransactionScope works in some places and not in others

Using ASP.NET 3.5, Linq to SQL, SQL Server 2005 on Windows Server 2003. Running VS 2008 on XP SP3 locally. We need to be able to wrap inserts, updates, and deletes in a transaction. When we first tried this by wrapping code blocks with using(var trans = new TransactionScope()) { ...; trans.Complete(); }, we got an appropriate exception ...

Using Small Business Accounting API with TransactionScope

Hi I want to wrap data operations involving 2 dbs one of which is an SBA db using the SBAAPI. Several problems arise: 1. The API insists on the transaction Isolation level being Snapshot. Any other level gives and error. 2. When I use Snapshot level, I get an error "SQL Server does not exist, the service is stopped, or access is denied"...

SQLite with TransactionScope and Increment Identity Generator

When trying to use SQLite with System.Transactions TransactionScope with the identity generator as Increment, i noticed that i was getting an exception (given below along with code) when NHibernate was trying to retrieve the next Identity number. This seems to be because the new SQLite connection is doing a auto enlist of the current tr...

MSDTC - Communication with the underlying transaction manager has failed (Firewall open, MSDTC network access on)

I'm having problems with my ASP.NET web forms system. It worked on our test server but now we are putting it live one of the servers is within a DMZ and the SQL server is outside of that (on our network still though - although a different subnet) I have open up the firewall completely between these two boxes to see if that was the issu...

Why is TransactionScope operation is not valid?

I have a routine which uses a recursive loop to insert items into a SQL Server 2005 database The first call which initiates the loop is enclosed within a transaction using TransactionScope. When I first call ProcessItem the myItem data gets inserted into the database as expected. However when ProcessItem is called from either ProcessItem...

How to implement a memory transaction scope in C#?

Hi, we have a cache which I would like to put some transaction scopes around so that any process have to explicitly 'commit' the changes it wants to do to the cached objects and make it possible to rollback any changes when the process fails halfway as well. Right now, we're deep cloning the cached objects on get requests, it works but ...

Failed Castle ActiveRecord TransactionScope causes future queries to be invalid

I am trying to solve an issue when using a Castle ActiveRecord TransactionScope which is rolled back. After the rollback, I am unable to query the Dog table. The "Dog.FindFirst()" line fails with "Could not perform SlicedFindAll for Dog", because it cannot insert dogMissingName. using (new SessionScope()) { try { var trans = new T...

How to handle request-wise DB transactions in ASP.NET MVC?

I'm using SubSonic 3.0 (SimpleRepository) to handle database access in my ASP.NET MVC 1.0 application. It would be nice to handle a transaction for every web request, committing if everything went smooth and rolling back in case of exception. Is this possible? If so, how? I know this topic has been discussed many times, but I just coul...

TransactionScope() in Sql Azure

Does Sql Azure support using TransactionScope() when performing inserts? Below is a code snippet of what I am trying to do. using (var tx = new TransactionScope(TransactionScopeOption.RequiresNew, new TransactionOptions() { IsolationLevel = IsolationLevel.ReadCommitted })) { using (var db = MyDataContext.GetD...

Nested Transaction issues within custom Windows Service

I have a custom Windows Service I recently upgraded to use TransactionScope for nested transactions. It worked fine locally on my old dev machine (XP sp3) and on a test server (Server 2003). However, it fails on my new Windows 7 machine as well as on 2008 Server. It was targeting 2.0 framework; I tried targeting 3.5 instead, but it still...