Is IDbCommandInterceptor in EntityFramework 6 thread safe

為{幸葍}努か 提交于 2019-12-10 21:22:58

问题


Is a IDbCommandInterceptor instance considered thread-safe when registered with the DbInterception add method? I have implemented a class that conforms to the IDbCommandInterceptor interface and am tracking the start time of a command when one of the executing methods are invoked compared to the stop time when the corresponding executed method is called. I'm storing this information in a private ivar list and need to know if what I'm doing is safe.


回答1:


As it turns out the IDbCommandInterceptor is not thread safe as it is only instantiated once.



来源:https://stackoverflow.com/questions/20431659/is-idbcommandinterceptor-in-entityframework-6-thread-safe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!