Entity Framework and multithreading

前端 未结 1 1059
时光取名叫无心
时光取名叫无心 2021-02-20 00:35

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 proces

1条回答
  •  花落未央
    2021-02-20 01:12

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

    0 讨论(0)
提交回复
热议问题