Reference Counting of Row Handles

OLE DB Programmer's Reference

Row handles are of type HROW and are not COM objects. Nevertheless, each row handle has its own associated reference count. These reference counts are incremented by calling IRowset::AddRefRows and decremented by calling IRowset::ReleaseRows. All methods that fetch rows are required to increment the reference counts on the returned row handles. The provider holds the rows until the consumer releases them with IRowset::ReleaseRows. The consumer must call ReleaseRows on a row once for each time it was fetched and each time AddRefRows was called on it.

Rows held by the provider are freed after the rowset's final reference has been released or after all references on the row handle have been freed. Deleting a row does not release the row handle. It does not matter whether the row is deleted by calling IRowsetUpdate::Update on a row with a pending deletion, calling IRowsetUpdate::Undo on a row with a pending insert, or calling IRowsetChange::DeleteRows: The consumer must call IRowset::ReleaseRows to release the row.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net