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

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Transactions and isolation levels » Isolation level tutorials


Tutorial: Understanding non-repeatable reads

The following tutorial demonstrates the type of inconsistency that can occur when multiple transactions are executed concurrently: the non-repeatable read. In this scenario, two employees at a small merchandising company access the corporate database at the same time. The first person is the company's Sales Manager; the second is the Accountant.

The Sales Manager wants to offer a new sales price on plastic visors. The Accountant wants to verify the prices of some items that appear on a recent order.

This example begins with both connections at isolation level 1, rather than at isolation level 0, which is the default for the SQL Anywhere sample database. By setting the isolation level to 1, you eliminate the possibility of dirty reads.


For this tutorial to work properly, the Automatically Release Database Locks option must not be selected in Interactive SQL. You can check the setting of this option by clicking Tools » Options, and then clicking SQL Anywhere in the left pane.

 See also

Lesson 1: Creating a non-repeatable read
Lesson 2: Avoiding non-repeatable reads using snapshot isolation