12

I have a WCF service that processes some messages. I use EntityFramework to retrieve the messages. I add these messages to a ThreadPool queue and then process them. After processing all the messages, I call an update on the Entity Framework to update the status of the messages.

Durng this operation, I randomly get the error - "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."

This error is thrown when the ReportPropetychanged event for a particular attribute gets fired.

Any help would be appreciated.

Regards

Andy

1 Answer 1

15

Don't share an ObjectContext -- or any object attached to it -- between threads. It is documented to be non-thread-safe.

Sign up to request clarification or add additional context in comments.

1 Comment

how not to share the object context? if it is in one uow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.