Udostępnij za pośrednictwem


Provider Threading Models

Providers can support single, apartment, or free-threaded OLE DB objects as long as they advertise which models are supported. It is recommended that providers build free-threaded implementations, which provide the best combination of speed and safety.

The threading model of a provider is described by a combination of the threading model registered for its Class ID in the registry, the DBPROP_DSOTHREADMODEL property, and the DBPROP_ROWTHREADMODEL property. The threading model for all nonrowset objects supported by the provider is described by the property DBPROP_DSOTHREADMODEL, and the threading model for rowsets is described by the property DBPROP_ROWTHREADMODEL. The threading model returned in DBPROP_DSOTHREADMODEL and DBPROP_ROWTHREADMODEL might be stricter than the thread model registered under the provider's CLSID in the case where additional threading limitations are imposed by underlying components, or where different services are invoked to support different objects. For more information, see Rowset Property Group in Appendix C: OLE DB Properties.