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.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|