The following tutorial demonstrates the type of inconsistency that can occur when multiple transactions are executed concurrently: the phantom row. 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 create new departments for foreign sales and major account sales. The Accountant wants to verify all the departments that exist in the company.
This example begins with both connections at isolation level 2, rather than at isolation level 0, which is the default for the SQL Anywhere sample database. By setting the isolation level to 2, you eliminate the possibility of dirty reads and non-repeatable 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|