The cached updates layer

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

The cached updates layer

Return to chapter overview

The cached updates layer keeps track of all the changes that are made by users by intercepting various table methods such as insert record, modify record, and delete record. As users browse through the table, the cached updates layer recognizes which records are modified, deleted, and inserted. The layer presents those records to the users accordingly. The updates are not immediately sent to the underlying table; instead they are cached by the cached updates layer. No record locks are held until the clients decide to commit the updates. Then the locks are held only during the commit process.

Because no record locks are held before the commit operation, there is a risk that some records might be updated by other users. If a record modified by the cached updates layer is modified by other users before the cached updates layer commits its cached updates, an error is returned, indicating that the record has been modified by a different user.

For standard database tables, every non-blob field is used in determining the record modifications.

After making the required changes, the clients call DbiApplyDelayedUpdates either to commit or rollback the changes. The rollback operation quickly discards the update information from the cache.

If the user decides to commit the changes, the updates are applied to the database. As the updates are applied, referential integrity and data validation checks are made.

A callback mechanism informs the users about data integrity violations. This mechanism can skip a particular failed update or abort the entire commit operation. See Callback functions.

Limitations

The cached updates layer works on one cursor at a time. If clients want to support cached updates on a form operating on more than one cursor, it is the client's responsibility to synchronize the updates on various cursors.

A few BDE calls that perform table operations are not supported by the cached updates layer, including data-ordering BDE calls, such as DbiSwitchToIndex. These can be done before entering the cached updates mode. The cached updates layer depends on bookmarks to keep track of modified records. Because bookmarks change when DbiSwitchToIndex is called, this BDE function is disabled.

 

hmtoggle_plus1Cached updates topics
hmtoggle_plus1Accessing and updating tables