Threading and OLE Objects

OLE DB supports two kinds of OLE objects in columns and parameters: storage objects and IPersist* objects.

Rowsets are factories of storage objects and determine the threading model of these objects. While accessing a storage object through IRowset::GetData, free-threaded rowsets return free-threaded objects, and apartment rowsets return apartment objects that will belong to the same thread.

IPersist* objects are implemented by the other parties. Their threading model is dictated by threading marking of their class factory. This marking may be absent and, if present, it can be either "Apartment" or "Both." Consumers need mechanisms to obtain information about the IPersist* object's threading marking when GetData returns the object.

For more information about storage objects and IPersist* objects, see Chapter 7, "BLOBs and OLE Objects."