问题描述
时当用DbInterception add方法注册被认为是线程安全的一个IDbCommandInterceptor实例?我已经实现了符合IDbCommandInterceptor接口的类并且当执行方法之一被调用时相比相应的执行方法被调用的停止时间很跟踪一个命令的开始时间。我存储在一个私人伊娃列表此信息,并需要知道我在做什么是安全的。
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.
推荐答案
事实证明了IDbCommandInterceptor不是线程安全的,因为它是唯一实例化一次。
As it turns out the IDbCommandInterceptor is not thread safe as it is only instantiated once.
这篇关于是IDbCommandInterceptor中的EntityFramework 6线程安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!