使用LINQ to SQL时避免连接超时的最佳实践 [英] best practice for avoid connection timeout when using LINQ to SQL
问题描述
我需要了解最佳实践,以避免在.net应用程序中使用LINQ to SQL时特别是从数据访问层或层返回IQueryable<T>
时避免连接超时.
i need to know best practice for avoid connection timeout when using LINQ to SQL in .net applications specially when returning IQueryable<T>
from data access tiers or layers.
我得到超时已到期.从池中获取连接之前已经过超时时间.这可能是因为所有池中的连接都在使用中,并且已达到最大池大小."测试我的asp.net应用程序进行Webstress测试时出现错误 ?
I get "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." error when testing my asp.net application for webstress tests ?
推荐答案
http://www.geekscrapbook.com/2010/08/13/connection-timeout-using-linq-datacontext/
链接将向您解释Timeouut使用LINQ to SQl的原因.您可以手动增加查询执行时间.默认情况下,查询时间为30秒. 根据Visual Studio 2008转到
Link will explain you what will be the reason of Timeouut using LINQ to SQl.You can manually increase the query execution time.By default its 30 sec. According to Visual studio 2008 Go to
工具->数据库工具->查询和看法 设计
Tools->Database Tools->Query & view design
在这里,您将获得增加执行时间的选项. 希望对您有帮助.
Here you will get the option to increase the execution time. Hope it helps you.
祝你好运
这篇关于使用LINQ to SQL时避免连接超时的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!