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 错误?更多信息?
基础教程推荐
- 将数据集转换为列表 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 如果条件可以为空 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
