交易范围超时(10分钟) [英] Transaction scope timeout on 10 minutes

查看:88
本文介绍了交易范围超时(10分钟)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中运行了 TransactionScope 的时间很长。我告诉示波器它的时间跨度应该很长,但是仍然超时。可能是什么原因造成的?

I have a long running TransactionScope in C#. I told the scope that it should have a long timespan, but still I get a timeout. What could cause this?

TransactionOptions transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = IsolationLevel.ReadCommitted;
transactionOptions.Timeout = TimeSpan.MaxValue;
using (var ts = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
{ 
    DoLongCode();
}


推荐答案

您可以在其中验证maxTimeout您的配置文件,如果您的web.config或app.config中没有此部分

Hello you can verify maxTimeout in your config file, if you don't have this section on your web.config or app.config

验证您的计算机.config

Verify your machine.config

<configuration> 
  <system.transactions>
    <machineSettings maxTimeout=""/>
  </system.transactions>
</configuration> 

调整值

这篇关于交易范围超时(10分钟)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆