Lifetime of Row Handles and Chapters

Lifetime of row handles and 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.

Note, however, that some providers may keep an implicit reference on the parent row handle until the chapter handle obtained from that row is released. Thus, if the DBPROP_CANHOLDROWS property is VARIANT_FALSE for the rowset, the consumer will not be able to obtain additional rows from the parent rowset until all chapters are released for the current set of held row handles. In general, 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 ReleaseChapter for any retrieved chapters before calling GetData in order to retrieve (and thus implicitly take a reference on) another chapter handle. Attempting to call GetData on a column containing a chapter handle in this case will return DB_E_CHAPTERNOTRELEASED.