CommandTimeout 似乎没有效果 30 秒后查询仍然超时
我们的生产数据库的大小已经增长到我们的几个运行时间较长的存储过程需要超过默认的 30 秒才能完成。我已经以编程方式在命令对象上设置了一些 CommandTimeouts,但对存储过程的调用似乎仍然在 30 秒后超时。
这就是我所做的:
在 web.config 中设置此属性
add key="CommandTimeOut" value="180"
将此添加到需要设置超时的类的顶部:
Dim COMMAND_TIMEOUT As Integer = ConfigurationManager.AppSettings("CommandTimeOut")
创建命令对象后,在对象上设置超时属性。
cmd.CommandTimeout = COMMAND_TIMEOUT
不幸的是,当执行时间超过 30 秒时,我的存储过程似乎仍然超时。任何帮助将不胜感激。
Our production database as grown to a size where several of our longer running stored procedures are taking more than the default 30 seconds to complete. I've programatically set some of the CommandTimeouts on the command objects but the calls to the store procedures still appear to be timing out after 30 seconds.
Here's what I did:
In web.config set this property
add key="CommandTimeOut" value="180"
Added this to the top of my class that needs the timeout set:
Dim COMMAND_TIMEOUT As Integer = ConfigurationManager.AppSettings("CommandTimeOut")
After creating the command object set the timeout property on the object.
cmd.CommandTimeout = COMMAND_TIMEOUT
Unfortunately my stored procedures still seem to be timing out when they take longer than 30 seconds to execute. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查事务和连接超时设置是否超过 30 秒...
希望这可以有所帮助,
再见
cghersi
Check that the Transaction and Connection timeouts are set with more than 30 seconds...
Hope this can helps,
Bye
cghersi