I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback). Is this accurate or hearsay? I couldn't track down information on the web that talked about this issue (if it IS an issue), so I wonder if anyone has any direct experience with it and can shed some light?
Asked
Active
Viewed 5,922 times
2 Answers
31
The behaviour that Marc Gravell described has been changed in .Net 4.0. Instead of the operation being autocommitted, it will now throw an InvalidOperationException. So in 4.0 you no longer need to use Explicit Unbind.

Jared Moore
- 3,765
- 26
- 31
27
If you mean in relation to SQL Server, then there is an issue that you can fix in the connection string; see my reply here, or the full details here.
The short version is: ensure you have Transaction Binding=Explicit Unbind;
in the connection string.
It isn't actually doing a vote commit - the transaction (and any early operations) has rolled back, but any subsequent operations (still inside the TransactionScope
) can get performed in the nul-transaction, i.e. auto-commit.

Community
- 1
- 1

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
-
Is this the same behavior for other databases like informix ? – Anyname Donotcare Jan 21 '15 at 07:20
-
1@just_name it would be provider dependent; I do not know specifically for informix - you would have to consult their documentation – Marc Gravell Jan 21 '15 at 13:41