如何在调试应用程序期间定义事务超时
我正在测试下面列出的 app.config 中的选项是否应用于应用程序中的所有事务。
<system.transactions>
<defaultSettings timeout="00:05:00" />
</system.transactions>
事务是使用事务范围以以下方式定义的
using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required))
是否可以找出事务范围创建的事务的超时时间?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 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