transactionscope

LINQ and TranscationScope not working

I am using LINQ select statement wrapped in a TransactionScope (to change the locking) but according to SQL Profiler, it doesn't seem to be working. My code looks like: using (var ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadUncommitted} )) { using (myDBDataCo...

NServiceBus - Problem with using TransactionScopeOption.Suppress in message handler

I have an endpoint that has a message handler which does some FTP work. Since the ftp process can take some time, I encapsulated the ftp method within a TransactionScope with TransactionScopeOption.Suppress to prevent the transaction timeout exceptions. Doing this got rid of the timeout exceptions, however the handler was fired 5 times ...

c# get current connection in TransactionScope transaction

Hi, I want to make transactional a series of sp call (sql server 2005) in a .net 2.0 project surrounding some piece of business logic with a using(TransactionScope...) Unluckily, I inherited the DAL from another project and I don't want to make many changes there..the problem is that every method that calls a stored procedure opens...

Using TransactionScope with MSDTC service stopped for a local database

After some discussions with LLBL we have decided that we will end up using MSDTC and Distributed Transactions in order to be able to use implicit Transactions and TransactionScope. See here for details about that decision. Now we did some testing on what needs to be done for the service to be installed correctly.It seems that when th...

SqlConnection and TransactionScope Timeout

I have a TransactionScope (over DTC, read committed) with a timeout of 60 minutes. In the TransactionScope I have opened the connection (I hope to enlist in the transaction) but after 30 seconds I get a timeout. In the machine.config I changed the system.transaction maxTimeout to 60 minutes. Why does the timeout occur after 30 seconds?...

NHibernate TransactionScope problem with Oracle 11g

The following code snippet works fine with SQL Server 2008 (SP1) but with Oracle 11g the call to session.BeginTransaction() throws an exception with the message ‘Connection is already part of a local or a distributed transaction’ (stack trace shown below). Using the '"NHibernate.Driver.OracleDataClientDriver". Has anyone else run into ...

Getting NHibernate session to see uncommited, external ADO.NET changes within TransactionScope

I have some code that does something like this: public void DoDatabaseWork() { _repositoryIDontControl.SaveSomeStuff(objectThatNeedsStuff.Stuff); using (var session = ... ) { session.Save(objectThatNeedsStuff); } } The crux here is that within my NHibernate mapped data model I have an object that references anothe...

WF4 Transactions and Persistence

Hi! I have a couple of questions about transactions in WF4... According to this http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/aeab2bcd-26c6-49be-8e08-d65ee2688038 4) There is an implicit Persistence Point at the end of both the TransactionScope and TransactedReceiveScope activities. The persistence operation is ti...

Isolated ADO.NET connection and transaction within a transactionscope

Background: I have an ASP.NET MVC application that wraps controller actions in a TransactionScope using an Action Filter. Further downstream (in my infrastructure layer); I'd like to open up a new ADO.NET connection (to the same db as my outer TransactionScope, if that is relevent) and have it participate in its own transaction - withou...

Do we have to have to enable MSDTC to use TransactionScope?

Do we have to have to enable MSDTC to use TransactionScope? I am using TransactionScope and I had error message telling me that the MSDTC not enabled. So I have enabled it. Why am I having this error message? Is that normal? What`s MSDTC use? Is transactionScope SQLSecver specific? ...

How to retry a transaction that has failed because of a deadlock?

I use linq-sql and this is what I need. Sub Commit() Try StepStart: Transaction Scope Serialized Begin Transaction Check BusinessRule1 Check BusinesRule2 if BusinessRulesFailed { Transaction.Rollback } else { Query = db.out db.SubmitChanges() Transaction.Commit() } Catch DeadLockException Goto StepStart End Try End Sub Is it ok ...

MySQL Connector/NET - support for transactions under Mono

Does anyone know how to get MySQL transactions working under Mono? I'm using MySQL Connector/NET (via Subsonic 3) and it works perfectly under Microsoft .NET. Recently however I tried running the same site under Mono on Ubuntu and it almost works - except I can't seem to get transactions working. Reading around the Mono/MySQL sites ...

What to do when neither TransactionScope nor nested transactions are supported?

TransactionScope is an amazing feature but too few providers do implement it correctly. I don't want to pass the connection as parameter. ...

2 sibling nested transactionScope gives: the Transaction has aborted

this code gives me the error: the Transaction has aborted. if I remove 1 nested transaction than it doesn't throw using(var scope = new TransactionScope()) { repo.Insert(new Foo {Fname = "aaaa"}); using(var s = new TransactionScope()) { repo.Insert(new Foo { Fname = "aaaa" }); //if ...

TransactionScope causing blocking?

I'm writing some Unit tests against a database, and we're using transactions to make sure that our test data gets removed at the end. I'm running into a problem where methods that I'm testing are using their own TransactionScope objects, and it seems to be blocking when hitting the database. This is inside my test's base class: BaseSc...

Why isn't TransactionScope rolling back distributed transactions?

I am using an object persistence framework called ECO for updating data to SQL Server. I've noticed that if I create a TransactionScope and then deliberately throw an exception after my first transaction has committed but before my second has committed the first database is updated and the 2nd is not. I thought that simply creating the...

Transaction not rolling back

I have a transation that doesn't seem to rollback and getting a strange error. I'm using a transaction that is connected to SQL Server 2008 on a different server and MSMQ on the same server as the code. Here is an example of the code: void MyMethod() { try { using (var outterTrans = new TransactionScope())...

.NET BackgroundWorker and SQLTransactions

Hi, Where can I find information or how can I handle SQL Server transactions in a BackgroundWorker thread? It's my understanding that error handling should not be set in the "DoWork" event and that the error is handled internally and passed to the 'RunWorkerCompleted". I am currently using SubSonic as my DAL and passing some lengthy ins...