I have a database model which I have imported in my code using Entity Framework(EF). There are some entities that are created by EF. I retrieve x no of entities using Function import and then my business logic works directly on those retrieved entities
and updates certain properties based on some logic. what I am doing is, for each entity i am creating a new thread and applying my business logic on them using an action chain that I have built. So, there is one entity passed to a thread and all of them are
being processed asynchronously. The problem now is that I keep on getting this weird exception every now and then (the exception is not consistent, it comes from any action in the action chain for any property),
"EntityMemberChanged or EntityComplexMemberChanged was called without first calling EntityMemberChanging or EntityComplexMemberChanging on the same change tracker with the same property name. For information about properly reporting changes, see
the Entity Framework documentation".
Moved byPaul ZhouFriday, December 9, 2011 9:00 AMmove for better support (From:.NET Base Class Library)
I think the root cause is an instance of ObjectContext was shared in many threads.
Any instance members of this class are not guaranteed to be thread safe. More information about ObjectContext, please refer
here.
I think the root cause is an instance of ObjectContext was shared in many threads.
Any instance members of this class are not guaranteed to be thread safe. More information about ObjectContext, please refer
here.