Questions tagged [system.transactions]

37 questions
30
votes
1 answer

How to create a class that works with TransactionScope?

Just wondering, if I want to create a class that does something and I want to be able to be used in a TransactionScope, what would I need to implement? That is: My class needs to be aware that it's in a Transaction, but how would it get notified on…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
29
votes
5 answers

Network access for Distributed Transaction Manager (MSDTC) has been disabled

error: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool. using…
Nick Kahn
  • 19,652
  • 91
  • 275
  • 406
15
votes
2 answers

Session-Per-Request with SqlConnection / System.Transactions

I've just started using Dapper for a project, having mostly used ORMs like NHibernate and EF for the past few years. Typically in our web applications we implement session per request, beginning a transaction at the start of the request and…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
13
votes
2 answers

Trace why a transaction is escalated to DTC

Is there any way to determine precisely why a System.Transaction TrasactionScope is being escalated to the DTC? We are hitting a bump with one of our components that seem to escalate the transaction while all other components (which seem deceptively…
soren.enemaerke
  • 4,770
  • 5
  • 53
  • 80
11
votes
2 answers

using TransactionScope : System.Transactions.TransactionAbortedException: The transaction has aborted

We're trying to do indirect nesting transaction using the code below, .NET 3.5 ,& SQL Server 2005. MSDN says that when using TransactionScope, a transaction is escalated whenever application opens a second connection (even to the same database)…
Pete Brook
  • 111
  • 1
  • 1
  • 3
7
votes
2 answers

.net durable resource manager for transactional filesystem access

I'm trying to wrap my head around the use of the System.Transactions namespace in C#. I've found some documentation on MSDN regarding using resource managers, but it only covers volatile, in-memory resource managers in any detail (like…
sgibbons
  • 3,620
  • 11
  • 36
  • 31
7
votes
4 answers

Strategies to Avoid Transaction Escalation in System.Transactions

So, based on the answer to my previous question, transactions do get elevated from the LTM to the DTC if multiple connections are opened during a transaction, even if the connections all have the same connection string. So, my next question is, what…
7
votes
2 answers

what is practical use of System.Transactions?

I have seen System.Transactions namespace, and wondered, can I actually make a RDMBS with this namespace usage? But when I saw some examples, I do not understand how System.Transactions does anything beyond simple try catch and getting us…
Akash Kava
  • 39,066
  • 20
  • 121
  • 167
6
votes
5 answers

TransactionInDoubtException using System.Transactions on SQL Server 2005

The underlying question to this post is "Why would a non-promoted LTM Transaction ever be in doubt?" I'm getting System.Transactions.TransactionInDoubtException and i can't explain why. Unfortunately i cannot reproduce this issue but according to…
Mark
  • 5,223
  • 11
  • 51
  • 81
5
votes
2 answers

TransactionScope across AppDomains and processes

Is it real to use System.Transactions (primarily TransactionScope) across different AppDomains and processes? DependentTransaction works only inside one AppDomain.
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
5
votes
0 answers

Why does Transaction.Current become null after Cross-AppDomain call?

Consider the following small program that simply creates a TransactionScope, prints Transaction.Current, calls a method in another AppDomain (that takes a while to execute) and then prints Transaction.Current upon return. using System; using…
DeCaf
  • 6,026
  • 1
  • 29
  • 51
5
votes
1 answer

Unhandled Exception in System.Transactions stops Windows Service during network instability

We are running an NServiceBus-based service, using the NServiceBus.Host.exe host process. Twice in production during the last few months the Windows Service has suddenly stopped, leaving the following event in the Application Event…
Svein Fidjestøl
  • 3,106
  • 2
  • 24
  • 40
5
votes
0 answers

MSDTC attempts to enlist client machine in a distributed transaction

We're seeing the following intermittent warning logged by MSDTC: A caller has attempted to propagate a transaction to a remote system, but MSDTC network DTC access is currently disabled on machine 'X'. Please review the MS DTC configuration…
4
votes
3 answers

Inner TransactionScope with different IsolationLevel, how can it be achieved?

The current implementation of TransactionScope lacks the ability to change IsolationLevels in nested scopes. MSDN states: When using nested TransactionScope objects, all nested scopes must be configured to use exactly the same isolation level if…
Ivan Zlatanov
  • 5,146
  • 3
  • 29
  • 45
4
votes
2 answers

Using TransactionScopeOption.Suppress with Sql Server Compact 4

I'm having trouble suppressing part of a transaction using Sql Server CE 4 with Entity Framework and System.Transactions.TransactionScope. The simplified code below is from a unit test demonstrating the problem. The idea is to enable the innerScope…
1
2 3