Skip to content

SqlServer connection undisponse in version 3.0 #477

@bao2314483

Description

@bao2314483

问题版本:CAP3.0.0
运行数据库:sqlserver2016
问题描述:在运行一段时间时间发生大量sleeping链接不释放,CMD值为AWAITING COMMAND,随着时间增长导致上升到100条之后,导致EF也相应报错
An exception occurred while iterating over the results of a query for context type 'ChySystem.EFCore.ChyContext'.
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语句 ===> sp_who '登录名'

我也曾经以为自身使用EF未释放导致,直到我采用了x.UseInMemoryStorage()之后,数据库链接能正常释放了

经过测试,发现无论使用x.UseSqlServer()或者x.UseEntityFramework();都不能与EF连接复用,貌似CAP死死占用链接而不释放

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions