[英]Entity Framework and connection string max Timeouts
I'm using a DbContext and want set CommandTimeout = 1 week. 我正在使用DbContext并希望将CommandTimeout设置为1周。 What is max timeout value for CommandTimeout?
CommandTimeout的最大超时值是多少?
((IObjectContextAdapter)this.context).ObjectContext.CommandTimeout = ?max?;
In connection string I also need set max time out value. 在连接字符串中,我还需要设置最大超时值。 What is max Connect Timeout value i can set?
我可以设置的最大连接超时值是多少?
<connectionStrings>
<add name="TestEntities" connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=DBTest;user id=sa;password=p/w; Connect Timeout=?max?; MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely). 值0表示没有限制(尝试执行命令将无限期等待)。 So 'indefinitely' is max value.
因此,“无限期”是最大值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.