是微软企业库数据访问应用程序块线程安全的?微软、线程、企业库、应用程序

2023-09-07 08:42:26 作者:缱倦旧时光

我似乎无法找到有关线程安全的任何文件...

I can't seem to find any documentation regarding thread safety...

在特别 - 是数据库类(和子类)线程安全的。

In particular - is the Database class (and subclasses) thread safe

我怎么会发现这一点为自己?是否有参考线程安全的类在MSDN网站?

How would I find this out for myself? Are there references to thread safety for classes on the MSDN site?

推荐答案

是的,数据库类的实例是线程安全的。然而,它创建的对象(如 SqlDataReader的)都没有。

Yes, instances of the Database class are thread-safe. However, objects created by it (such as SqlDataReader) are not.