jjzjj

dbEntities

全部标签

c# - 使用 EF4(edmx 模型)时偶尔出现 "The underlying provider failed on Open"错误

我希望有人能帮我解决以下错误。发生错误的应用程序正在生产中运行,我自己从未遇到过错误。然而,我每天大约有20次收到错误邮件,告诉我:TheunderlyingproviderfailedonOpen.--->System.InvalidOperationException:Theconnectionwasnotclosed.Theconnection'scurrentstateisconnecting.这是堆栈跟踪System.Data.EntityException:TheunderlyingproviderfailedonOpen.--->System.InvalidOperati

c# - EF DBContext 处理不关闭连接

我使用的是EF6.1.0我有下面的自定义DBContex对象作为DBEntitespublicpartialclassDbEntities:DbContext{publicDbEntities():base("name=DbEntities"){////Configuration.LazyLoadingEnabled=true;////Configuration.ProxyCreationEnabled=false;}////IhaveALLEntitesaddedasbelow////publicvirtualIDbSetCCodes{get;set;}}我对上下文对象有以下操作us