TransactionScope bug in .NET? More information?(.NET 中的 TransactionScope 错误?更多信息?)
问题描述
我已经读到(或者可能从同事那里听说)在 .NET 中,TransactionScope 可以达到超时,然后是 VoteCommit(而不是 VoteRollback).这是准确的还是道听途说的?我无法在网络上找到有关此问题的信息(如果它是一个问题),所以我想知道是否有人对此有任何直接的经验并且可以提供一些启发?
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?
推荐答案
如果您的意思是与 SQL Server 相关,那么您可以在连接字符串中修复一个问题;在此处查看我的回复,或完整的细节 这里.
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.
简短版本是:确保您在连接字符串中有Transaction Binding=Explicit Unbind;
.
The short version is: ensure you have Transaction Binding=Explicit Unbind;
in the connection string.
它实际上并没有进行投票提交 - 事务(和任何早期操作)已经回滚,但任何后续操作(仍在 TransactionScope
内)都可以在 nul-transaction 中执行, 即自动提交.
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.
这篇关于.NET 中的 TransactionScope 错误?更多信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:.NET 中的 TransactionScope 错误?更多信息?


基础教程推荐
- 使用 SED 在 XML 标签之间提取值 2022-01-01
- C# - 将浮点数转换为整数...并根据余数更改整数 2022-01-01
- Page.OnAppearing 中的 Xamarin.Forms Page.DisplayAlert 2022-01-01
- 覆盖 Json.Net 中的默认原始类型处理 2022-01-01
- 创建属性设置器委托 2022-01-01
- 我什么时候应该使用 GC.SuppressFinalize()? 2022-01-01
- C# - 如何列出发布到 ASPX 页面的变量名称和值 2022-01-01
- 如何使用OpenXML SDK将Excel转换为CSV? 2022-01-01
- 从 VB6 迁移到 .NET/.NET Core 的最佳策略或工具 2022-01-01
- 当键值未知时反序列化 JSON 2022-01-01