MDAC 2.5 SDK - OLE DB Providers
Cursor Service for OLE DB


 

Updates within the Synchronization Functionality

See Also    Interfaces               

To send updates and retrieve updated information, the Cursor Service keeps track of synchronization information. Upon rowset creation, the Cursor Service will attempt to obtain a pointer to the session object from which the rowset was created. Subsequently, the cursor's session can be set to a new value or set to null to disconnect the rowset.

The Cursor Service attempts to retrieve necessary metadata information from the cursor's IColumnsRowset interface. If necessary, the synchronization functionality obtains additional extended metadata information through implementation-specific means and saves it to the rowset's IColumnsRowset interface for future use—in this case, for the update request.

Updates requested through the Cursor Service are submitted through the synchronization service. When the Cursor Service's IRowsetUpdate::Update method is called, the session object is identified and row handles are passed to IRowsetUpdate::Update with a DBROWOP value of DBROWOP_UPDATE | DBROWOP_GETVISIBLE. The synchronization service determines the changes to be made to each row and the data to be used for optimistic-searched updates.

The synchronization service submits updates to the data store. For rows successfully updated, the underlying values are set, as is the status to DBROWSTATUS_S_OK, or to DBROWSTATUS_E_DELETED for deleted rows. For rows not successfully updated, the service passes DBROWSTATUS_S_NOCHANGE to prevent a change of the row status but still sets the underlying value (assuming DBROWOP_GETVISIBLE was specified).

The Cursor Service updates its internal values. For any rows whose status is DBROWSTATUS_S_OK, the rowset discards any pending changes and updates its original values. For any rows whose status is DBROWSTATUS_E_DELETED, it deletes the row from its caches.