Questions tagged [system.transactions]
37 questions
3
votes
1 answer
Promote Method returned an invalid Value for the Distributed transaction with TransactionScope and ODP.net
Upon opening a second connection inside of a transaction (a point at which I would expect a promotion) I recieve the above mentioned error.

b_levitt
- 7,059
- 2
- 41
- 56
3
votes
0 answers
TransactionInDoubt" using System.Transactions, Appearantly in TransactionScope.Complete()
We have this problem in our system. We're using System.Transactions and work with TransactionScope (mostly, and definitely in this case). We've just migrated from EnterpriseServices to SystemTransactions recently, and we got this error several…

Eyal Elkevity
- 69
- 1
- 7
3
votes
1 answer
Using transactions across processes
I'm trying to use System.Transactions (TransactionScope) to coordinate a set of processes, each of which does some database work. Ultimately all processes need to commit or be rolled back atomically via one parent process. Unfortunately, nothing…

Todd
- 530
- 4
- 14
2
votes
1 answer
Java Transactions API and .NET System.Transactions
I'm analyzing the different behaviors between the JTA (Java Transactions API) and the .NET counterpart System.Transactions: the approach is quite different between the two of them.
In fact, Java's version of Transactions seems more a specification,…

Antonello
- 1,326
- 2
- 16
- 23
2
votes
1 answer
"Unable to cast" exceptions originating in `System.Transactions.JitSafeGetContextTransaction`?
Just recently my app has been inconsistently throwing a variety of exceptions like these:
Unable to cast object of type 'System.Threading.Thread' to type 'System.Transactions.SafeIUnknown'.
Unable to cast object of type…

StayOnTarget
- 11,743
- 10
- 52
- 81
2
votes
1 answer
InvalidOperationException when calling Transaction.Current
I have code inside my DatabaseClient class that checks whether or not there is an active TransactionScope by examining the ThreadStatic property, Transaction.Current:
if (Transaction.Current == null)
{
// open a new connection and do things
}
I…

Dan
- 901
- 11
- 25
2
votes
1 answer
SQL CE 4 System.Transaction support
A similar question was asked here but had no answer.
I am attempting to use a System.Transactions.CommittableTransaction with EF CTP4 and SQL CE 4.
I have created the following transaction attribute for my ASP.NET MVC Controller actions:
public…

Ben Foster
- 34,340
- 40
- 176
- 285
2
votes
0 answers
Row-Level Update Lock using System.Transactions
I have a MSSQL procedure with the following code in it:
SELECT Id, Role, JurisdictionType, JurisdictionKey
FROM
dbo.SecurityAssignment WITH(UPDLOCK, ROWLOCK)
WHERE Id = @UserIdentity
I'm trying to move that same behavior into a component that…

indomitablehef
- 71
- 4
2
votes
0 answers
System.Transactions assembly loading
I'm trying to make a list of all referenced assemblies and assemblies in AppDomain. Every time I'm getting 25 ref.assemblies and after that - 39 assemblies in AppDomain.
But if I call AppDomain.CurrentDomain.GetAssemblies() one more time, I get one…

Oleksandr Hulak
- 21
- 2
1
vote
1 answer
Transaction Management with Mediatr and Dapper in Clean Architecture
I am getting following exception,
"messages": [],
"source": "Microsoft.Data.SqlClient.SqlCommand",
"exception": "BeginExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local…

SJI
- 21
- 4
1
vote
2 answers
Why is a nested transaction committed even if TransactionScope.Complete() is never called?
I was testing to see how nested transactions work, and uncovered this disturbing and unexpected behavior.
using(TransactionScope otx = new TransactionScope())
using(SqlConnection conn1 = new…

Adam M.
- 11
- 2
1
vote
5 answers
Transaction Scope
How does the transaction scope work? How does it know when there is another context being used already and how might I implement another kind of scope in my code.
I'm primarily a vb.net developer but I can read the c# if you write in that.
In case…

Middletone
- 4,190
- 12
- 53
- 74
1
vote
1 answer
Example of alternative to TransactionCompleted event?
From the MSDN entry for TransactionCompleted:
You can register for this event instead of using a volatile enlistment to get outcome information for transactions.
Caution Signing up for this event negatively affects the performance of the…

Daniel
- 47,404
- 11
- 101
- 179
1
vote
1 answer
How .net allows nested transactions with TransactionScopeOption
I have learned that Oracle & sql server database does not allow nested transactions. Then how does c# allow us to perform nested transactions using transactionscopeoption?

Praveen
- 21
- 2
1
vote
2 answers
Is something along the lines of nested memoization needed here?
System.Transactions notoriously escalates transactions involving multiple connections to the same database to the DTC. The module and helper class, ConnectionContext, below are meant to prevent this by ensuring multiple connection requests for the…

Daniel
- 47,404
- 11
- 101
- 179