entity-framework - 突然出现大量 EF 实现错误
问题描述
我们在项目中使用的是 Entity Framework 6.4.4,最近遇到了一个严重的问题。在运行 10-20 小时(可能大约一百万个请求)后,我们突然收到大量 EF 实现错误。看起来所有的 EF 映射都因为某种原因搞砸了,即使是 Find 等基本方法也使用了错误的属性。
我们收到的错误的几个示例:
The '...' property on '...' could not be set to a 'System.Byte' value. You must set this property to a non-null value of type 'System.Guid'. at
System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) at lambda_method(Closure , Shaper )
Shaper....SingleOrDefault[TSource]_InternalSet`1.FindInStore_InternalSet`1.Find
The '...' property on '...' could not be set to a 'System.Byte' value. You must set this property to a non-null value of type 'System.DateTime'
所有这些代码在某个特定时刻之前都有效,因此它看起来不像我们现有映射的问题。到目前为止,我们无法找到任何类似的问题。也许升级到 EF Core 可以解决这些问题,但这需要大量的时间投资,所以现在我们正在寻找一个临时解决方案。
有没有人知道可能导致这种情况的信息?我们希望至少弄清楚这是否主要是由负载过重引起的,以便我们可以优化和扩展我们的代码或我们的某种错误。
解决方案
推荐阅读
- javascript - 如何在 reactjs 组件中使用使用 scalajs 导出的函数?
- webpack - 在插件处理之前让 Webpacks file_loader 在 css 文件中读取和散列 url
- java - 自定义 Spring Boot AutoConfiguration 模块上的 IntelliJ 属性文件检测
- r - 如何将两个双层地块放在一起?
- javascript - 如何在 HTML 脚本中包含 node_module?(顺便说一句,使用 webpack)
- linux - VSCode 终端未在 Linux (POP_OS 20.10) 中打开
- javascript - 如何使用 jquery 选择和更改文本
- r - 混合列顺序,DBI::dbWriteTable 在 R 中用于 BigQuery
- sql - postgres 按月按时间顺序排列
- python - 使用 requests.json() 返回一个列表,而不是 JSON