什么是连接池,我可以设置最大池大小吗?

时间:2019-12-03 19:35:54

标签: c# asp.net-core entity-framework-core

我有一个正在运行的Web服务,当我检查发现的日志文件时有人抱怨超时错误

  

System.InvalidOperationException:超时已过期。从池中获取连接之前已经过超时时间。发生这种情况的原因可能是所有池化连接都在使用中,并且达到了最大池大小。

这里是我的数据库调用示例,超时错误来自此示例。

using (var t = new TransactionScope(TransactionScopeOption.Required,
                new TransactionOptions
                {
                    IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted
                }))
{
    _database.TableName.Add(new dboTableName()
    {
        CallingAppl = callingApp,
        DateTime = DateTime.Parse(timeStamp),
        Desc = desc
    });

    logID = _database.SaveChanges();
    t.Complete();
}

当我搜索时,发现与SqlConnection和ADO.net相关的内容,但我使用的是Entity Framework核心。

如何重现此问题?

0 个答案:

没有答案
相关问题