MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 18: Programming Considerations
Provider Threading Responsibilities
Free-threaded in-process OLE DB objects have the following threading responsibilities:
- To implement the guarding mechanisms necessary to guarantee safe operation of the OLE DB objects when objects are called from different threads. The choice of these mechanisms is provider-specific.
- To guarantee an operation free of deadlocks and of starvation.
- In the case of rowset objects, to shield other threads executing concurrently from the effects of methods like IRowsetUpdate::Update or IRowsetRefresh::RefreshVisibleData that may change the state of the rowset's copies of the rows. Update should be an atomic operation. While working in immediate update mode, all methods that modify the rowset's copies of the rows (IRowsetChange::SetData, IRowsetChange::DeleteRows, and so on) should also be atomic operations.
- In the case of rowset objects, to guarantee that all other provider-implemented objects for which the rowset is a factory (such as other rowsets or storage objects) are also free-threaded.
- To guarantee a minimum of marshaling support for their use by apartment-model consumers; for example, by aggregating to them an IMarshal object obtained from CoCreateFreeThreadedMarshaler. The provider can perform this aggregation lazily—that is, defer it until QueryInterface requests IMarshal.
Apartment model in-process OLE DB objects have the following threading responsibilities: