如何在调试应用程序期间定义事务超时

发布于 2024-08-04 04:37:03 字数 360 浏览 1 评论 0 原文

我正在测试下面列出的 app.config 中的选项是否应用于应用程序中的所有事务。

<system.transactions>
   <defaultSettings timeout="00:05:00" />
</system.transactions>

事务是使用事务范围以以下方式定义的

using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required))

是否可以找出事务范围创建的事务的超时时间?

I am testing whether option from app.config listed below Is applied to all transactions in the application.

<system.transactions>
   <defaultSettings timeout="00:05:00" />
</system.transactions>

Transaction are defined using transaction scope in following way

using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required))

Is it possible to find out what timeout has transaction created by transaction scope?

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

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

发布评论

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

评论(1

琴流音 2024-08-11 04:37:03

您可以使用 transactionoptions.timeout 来完成此操作,请参阅:

http://social.msdn.microsoft.com/Forums/en-US/windowstransactionsprogramming/thread/250b40b9-0838-4142-a8ff-d9d26690083b

编辑

交易范围没有任何公共属性,因此您将无法获取任何信息。您只能通过构造函数访问超时。

http://msdn.microsoft.com/en-us/库/system.transactions.transactionscope.aspx

You can do it using transactionoptions.timeout, see:

http://social.msdn.microsoft.com/Forums/en-US/windowstransactionsprogramming/thread/250b40b9-0838-4142-a8ff-d9d26690083b

EDIT

Transaction scope does not have any public properties, so you will not be able to get any information. You only have access to the timeout through the constructor.

http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx

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