SqlConnection 和 TransactionScope 超时

发布于 2024-09-24 12:00:19 字数 193 浏览 3 评论 0原文

我有一个超时为 60 分钟的 TransactionScope(通过 DTC,已提交读)。 在 TransactionScope 中,我已打开连接(我希望加入事务),但 30 秒后出现超时。

在 machine.config 中,我将 system.transaction maxTimeout 更改为 60 分钟。

为什么30秒后会超时?

I have a TransactionScope (over DTC, read committed) with a timeout of 60 minutes.
In the TransactionScope I have opened the connection (I hope to enlist in the transaction) but after 30 seconds I get a timeout.

In the machine.config I changed the system.transaction maxTimeout to 60 minutes.

Why does the timeout occur after 30 seconds?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉世弥音 2024-10-01 12:00:19

SqlCommand 已具有默认为 30 秒的 CommandTimeout 属性。可能您正在交易中使用它。

A SqlCommand already has a CommandTimeout property that defaults to 30 seconds. May be you are using it within your transaction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文