What is the best way to know if the code block is inside TransactionScope?
Is Transaction.Current a realiable way to do it or there are any subtleties?
Is it possible to access internal ContextData.CurrentData.CurrentScope (in System.Transactions) with reflection? If yes, how?
Thank you in advance.
Solution Here is more reliable way (as I said, T
When Method1() instantiates a TransactionScope and calls Method2() that also instantiates a TransactionScope, how does .NET know both are in the same scope?
I believe it doesn't use static methods internally otherwise it wouldn't work well on multithreaded applications like ASP.NET.
Is it possible to create my own TransactionScope-like class or do
There seems to be a little confusion surrounding the SharedDbConnectionScope and TransactionScope objects to enable wrapping your SubSonic queries within a transaction.
The docs suggest specifying the using SharedDbConnectionScope wrapped around the using TransactionScope...
using(SharedDbConnectionScope scope = new SharedDbConnectionSc
I'm trying to integrate async / await into our service bus.
I implemented a SingleThreadSynchronizationContext based on this example http://blogs.msdn.com/b/pfxteam/archive/2012/01/20/10259049.aspx.
And it works fine, except for one thing : TransactionScope. I await for stuff inside the TransactionScope and it break the TransactionScope.
When i create a TransactionScope object as followed:
using (TransactionScope ts = new TransactionScope())
// Do stuff...
What is the default transaction timeout of the given ts object?
Solution According to David Browne it is 1 minute
TransactionScope’s default constructor defaults the isolation level to Serializable and the timeout t
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) within the Transaction.
using(TransactionScope scope = new TransactionScope
EDIT: I am only accessing 1 database but a DTC transaction IS being created. I can see it in the DTC Transaction List GUI (Component services plugin). Why is this?
I need to perform a transaction (several insert commands) against 1 database.
Should I be using TransactionScope or IDbTransaction (connection.BeginTransaction)?
Consider the following:
using (var outerScope = new TransactionScope())
Now I want to have InsertDataInTableOne to be run outside of the outerScope transaction. This is a simplified representation, as the TransactionScope is creat
I just started playing around with Dapper. So far i love it. Does dapper not work with TransactionScope? I noticed that even if i never call TransactionScope.Complete then my changes are still committed to the database. If TransactionScope isn't supported now is there any plans in the future to support it? If not then you have to use traditional tr
Using the code below, the expected behavior is that the database won't reflect the update since ts.Complete() is never called but the updates seems to go through. But if I leave out the SharedDbConnectionScope then the expected behavior is seen. Is there a problem with SharedDbConnectionScope? Btw I am using Subsonic 2.2