Contents Index Typical types of inconsistency Setting the isolation level

ASA SQL User's Guide
  Using Transactions and Isolation Levels
    Isolation levels and consistency
      Typical types of inconsistency

Cursor instability

Another significant inconsistency is cursor instability. When this inconsistency is present, a transaction can modify a row that is being referenced by another transaction's cursor. Cursor stability ensures that applications using cursors do not introduce inconsistencies into the data in the database.

Example 

Transaction A reads a row using a cursor. Transaction B modifies that row. Not realizing that the row has been modified, Transaction A modifies it, rendering the affected row's data incorrect.

Eliminating cursor instability 

Adaptive Server Anywhere achieves cursor stability at isolation levels 1, 2, and 3. Cursor stability ensures that no other transactions can modify information that is contained in the present row of your cursor. The information in a row of a cursor may be the copy of information contained in a particular table or may be a combination of data from different rows of multiple tables. More than one table will likely be involved whenever you use a join or sub-selection within a SELECT statement.

For information on programming SQL procedures and cursors, see Using Procedures, Triggers, and Batches.

Cursors are used only when you are using Adaptive Server Anywhere through another application. For more information, see Using SQL in Applications.

A related but distinct concern for applications using cursors is whether changes to underlying data are visible to the application. You can control the changes that are visible to applications by specifying the sensitivity of the cursor.

For more information about cursor sensitivity, see Adaptive Server Anywhere cursors.


Contents Index Typical types of inconsistency Setting the isolation level