.NET 中的 TransactionScope 错误?更多信息?

TransactionScope bug in .NET? More information?(.NET 中的 TransactionScope 错误?更多信息?)
本文介绍了.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 错误?更多信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

ActiveDirectory error 0x8000500c when traversing properties(遍历属性时 ActiveDirectory 错误 0x8000500c)
search by samaccountname with wildcards(使用通配符按 samaccountname 搜索)
Get the list of Groups for the given UserPrincipal(获取给定 UserPrincipal 的组列表)
Can you find an Active Directory User#39;s Primary Group in C#?(你能在 C# 中找到 Active Directory 用户的主要组吗?)
How to register System.DirectoryServices for use in SQL CLR User Functions?(如何注册 System.DirectoryServices 以在 SQL CLR 用户函数中使用?)
Query From LDAP for User Groups(从 LDAP 查询用户组)