Refreshing Row Values

Once a row handle is retrieved from the provider, the nondeferred columns of that row are cached such that multiple calls to GetData return the same cached values. IRowsetRefresh gives the consumer a way to retrieve the data in the data source that is visible to the current transaction according to its isolation level corresponding to a set of row handles. This data is referred to as "visible data."

In order to retrieve the visible data for a row, the consumer calls IRowsetRefresh::GetLastVisibleData. To update the copy of a row in the rowset with the currently visible data, the consumer calls IRowsetRefresh::RefreshVisibleData with fOverwrite set to TRUE.

For performance reasons, visible data may itself be cached by the provider. The consumer calls IRowsetRefresh::RefreshVisibleData in order to refresh the provider's visible data cache. For deferred columns and for providers that do not keep a local cache of visible data, RefreshVisibleData with fOverwrite set to FALSE has no effect. However, consumers wanting to work with general providers should always call RefreshVisibleData before calling GetLastVisibleData for any nondeferred columns in order to be sure they are getting the latest data values from the data source.

Although the ability to obtain visible data is related to the DBPROP_OWNUPDATEDELETE, DBPROP_OWNINSERT, DBPROP_OTHERUPDATEDELETE, and DBPROP_OTHERINSERT properties, it is independent of them. In other words, the value of these properties can be VARIANT_FALSE and the rowset can still expose IRowsetRefresh. However, because of implementation difficulties, many rowsets do not expose IRowsetRefresh unless the values of the DBPROP_OWNUPDATEDELETE and DBPROP_OTHERUPDATEDELETE properties are VARIANT_TRUE.