Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Using Transactions and Isolation Levels » Isolation levels and consistency

Update conflicts and snapshot isolation Next Page

Typical types of inconsistency


There are three typical types of inconsistency that can occur during the execution of concurrent transactions. This list is not exhaustive as other types of inconsistencies can also occur. These three types are mentioned in the ISO SQL/2003 standard and are important because behavior at lower isolation levels is defined in terms of them.

Isolation levels and dirty reads, non-repeatable reads, and phantom rows

SQL Anywhere allows dirty reads, non-repeatable reads, and phantom rows, depending on the isolation level that is used. An X in the following table indicates that the behavior is allowed for that isolation level.

Isolation level Dirty reads Non-repeatable reads Phantom rows
0-read uncommitted X X X
readonly-statement-snapshotX1X2X3
1-read committed X X
statement-snapshotX2X3
2-repeatable read X
3-serializable
snapshot

1 Dirty reads can occur for updatable statements within a transaction if the isolation level specified by the updatable_statement_isolation option does not prevent them from occurring.

2 Non-repeatable reads can occur for statements within a transaction if the isolation level specified by the updatable_statement_isolation option does not prevent them from occurring. Non-repeatable reads can occur because each statement starts a new snapshot, so one statement may see changes that another statement does not see.

3 Phantom rows can occur for statements within a transaction if the isolation level specified by the updatable_statement_isolation option does not prevent them from occurring. Phantom rows can occur because each statement starts a new snapshot, so one statement may see changes that another statement does not see.

This table demonstrates two points:

The isolation levels have different names under ODBC. These names are based on the names of the inconsistencies that they prevent. See The ValuePtr parameter.


Cursor instability