Notifications

Notifications allow the provider layers to communicate changes in the underlying data source to other consumers or controls that register an interest. Notifications are required by the OLE DB Simple Provider DLL. The following figure shows how notifications are issued and received in the OLE DB Simple Provider framework:

There are three levels of notifications that occur in this framework:

OLE DB Notifications

These notifications are issued by the OLE DB Simple Provider DLL (MSDAOSP.DLL), and are consumed by any OLE DB control or application that wants to be notified about changes (through OLE DB) to a Rowset from other consumers. They are implemented through the IRowsetNotify OLE DB interface (for further information, refer to the online OLE DB Programmer's Reference supplied with the OLE DB SDK).

OSP Notifications

These notifications are issued by the OSP object and other objects that might be changing data owned by the OSP object. The notifications consist of methods belonging to the OSP OLEDBSimpleProviderListener interface. The listener for this set of notifications is the MSDAOSP.DLL. For example, suppose one OSP serves an array data source. If another object outside that OSP alters an element in the array data (using the SetVariant OSP method), then it must also issue the OSP notifications (for example, the OLEDBSimpleProviderListener::CellChanged method).

Data Source Notifications

These notifications are issued by the OSP Data Object. It is possible that other controls or applications not consuming data through the MSDAOSP.DLL may be refreshing or changing the same data source held by an OSP. In these cases, data source notifications come into play. For example, suppose a filter property on a control can alter array data exposed by an OSP. If the filter property is changed, then the code must issue data source notifications to indicate that the entire data source has changed.

Data source notifications are listened to by code that has requested data sources through the data binding interfaces (either IDataSource or msDataSourceObject through IDispatch). The listener depends on which object issued IDataSource::getDataMember. MSDAOSP.DLL will listen to these notifications (through DataSourceListener) when it requests an OSP. If a change to the data occurred, the Rowset being held by the OSP is in an invalid state ("zombie" state) and must be released. The application can make a fresh request to get the new data via IDataSource::getDataMember or msDataSourceObject.

Additional Information

OSP and data source listeners (OLEDBSimpleProviderListener and DataSourceListener) are not capable of vetoing or canceling a notification. Thus, developers do not need to check the results of a pre-notification to validate whether the data change has actually occurred.

MSDAOSP.DLL is capable of opening more than one rowset at a time on a simple provider, as long as the simple provider's Data Source and OSP objects support multiple listeners.  It is the provider writer's responsibility to accomodate multiple listeners by: