Transactions and cached updates

<< Click to Display Table of Contents >>

Navigation:  Application development > Transactions >

Transactions and cached updates

Previous pageReturn to chapter overviewNext page

When a transaction is active, updates are immediately sent to the underlying tables. Thus errors (such as integrity constraint violations, and so on) are instantly reported to the clients. Because updates are immediately sent to the underlying tables, the updates are visible to other transactions. And because each modified record is locked, other users cannot interfere.

This behavior differs from that of the cached updates layer (batch or burst updates), where updates are not sent to the underlying table until the commit time. Hence no errors are reported until the commit time. No record locks are held until the user decides to commit the updates. The locks are held only during the commit process. If errors occur during the commit process, clients are given an option to abort the commit process. If clients abort a commit process, the original state of the table is restored.

The main advantage of the cached updates feature is that the locks are held only during the commit time, thereby increasing the access time of SQL servers for other system transactions. Transactions lock out other users after record is changed, and local transactions limit the user to changing only the maximum number of records that can be locked. Cached updates avoid these problems, but permit another user to change data underneath you.

These differences are summarized in the following table:

 

 Advantages

 Disadvantages

Transactions

Updates immediately sent to tables.

Modified records instantly visible to other users.

Modified records are locked.

Errors instantly reported.

Lock out other users once a record is modified.

Local transactions limit users to changing only the maximum number of records that can be locked.

 

Cached updates

Locks are held only during commit time, increasing server access time for other transactions.

Cached updates can be used with any cursor on a single table.

Not limited to the maximum locks for dBASE (100) and Paradox (255) while modifying records. [When committing more than these maximums, an exclusive lock on the table is required to commit them.]

Permits another user to modify the records you are using without your realizing it.

If errors occur during commit process, you may abort, reverting table to its original state, losing all modifications

For more information, see Cached updates.

 

hmtoggle_plus1Transaction topics