我正在编写一个 .NET 4.0 控制台应用程序
- 打开连接 使用数据阅读器在键列表中游标
- 对于每个键读取,调用 Web 服务
- 将 Web 服务的结果存储在数据库中
然后,我生成此进程的多个线程,以提高每秒可以处理的最大记录数。
当我的进程超过大约 30 个线程时,我收到以下错误:
System.InvalidOperationException: 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.
是否有服务器或客户端选项可以调整以允许我从连接池中获取更多连接?
我正在调用一个 sql 2008 r2 数据库。
谢谢