碰到一个这种问题,可能是线上多个用户同时更新表T_Option的一条数据的同一个字段SelectCount造成的问题,挺经常发生的。自己本地测试没有问题。
试过修改savechange(saveoption)重载的参数,都没解决该问题
----日志监控扑捉到的以下错误:
System.InvalidOperationException: EntityMemberChanged or EntityComplexMemberChanged was called without first calling EntityMemberChanging or EntityComplexMemberChanging on the same change tracker with the same property name.
System.InvalidOperationException: EntityMemberChanged or EntityComplexMemberChanged was called without first calling EntityMemberChanging or EntityComplexMemberChanging on the same change tracker with the same property name.
----- 报错位置
at System.Data.Objects.EntityEntry.EntityMemberChanged(String entityMemberName, Object complexObject, String complexObjectMemberName)
...
at IPTVResearch.Model.T_Option.set_SelectCount(Int32 value)
-----
在对表的操作时加锁或用事务吧
去年实体框架把我还惨了,多人同时应用的时候你是不是用的同一个entity?????