At isolation level 3, a transaction acquires a read lock on every row it reads. Ordinarily, a transaction never releases a lock before the end of the transaction. In fact, it is essential that a transaction does not release locks early if the schedule is to be serializable.
SQL Anywhere always retains write locks until a transaction completes. This prevents another transaction from modifying that row and making it impossible to roll back the first transaction.
Read locks are released only in one circumstance: Under isolation level 1, transactions acquire a read lock on a row only when it becomes the current row of a cursor. Under isolation level 1, however, when that row is no longer current, the lock is released. This behavior is acceptable because the database server does not need to guarantee repeatable reads at isolation level 1.
For more information about isolation levels, see Choosing isolation levels.
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|