Freigeben über


Lifetime of Row Handles Within Chapters

The lifetime of row handles and the lifetime of their containing chapters are handled independently. Releasing a row handle containing a chapter does not imply that the row handles contained in the chapter are released or that the chapter contained in the row handle being released becomes invalid. To invalidate a chapter, the consumer must explicitly release it. Also, chapters may be used when navigating a child rowset, even after their containing row handle in the parent rowset has been released.

However, some providers keep an implicit reference on the parent row handle until the chapter handle obtained from that row is released. Therefore, if the DBPROP_CANHOLDROWS property is VARIANT_FALSE for the rowset, the consumer cannot obtain additional rows from the parent rowset until all chapters are released for the current set of held row handles. As a standard practice, consumers wanting to work with any provider should release all references on chapter handles before attempting to retrieve additional rows.

Providers may impose additional restrictions, such as supporting only one active chapter at a time on a rowset. For such providers, the consumer must call IChapteredRowset::ReleaseChapter for any retrieved chapters before calling IRowset::GetData in order to retrieve (and thus implicitly take a reference on) another chapter handle. In this case, attempting to call IRowset::GetData on a column containing a chapter handle returns DB_E_CHAPTERNOTRELEASED.