Understanding of SQL Server 2000 isolation level

Source: Internet
Author: User
When locking is used as a concurrency control mechanism, it can solve the concurrency problem. This allows all transactions to run in a fully isolated environment, but there can be multiple running transactions at any time.
Serializability is the database State achieved by running a group of concurrent transactions, which is equivalent to the database State achieved by this group of transactions in a certain sequence of continuous execution.

SQL-92 isolation level
Although serializability is important for transactions to ensure the correctness of data in the database during all time periods, many transactions do not always require full isolation. For example, multiple authors work in different chapters of the same book. New chapters can be submitted to the project at any time. However, the author cannot make any changes to an edited chapter without the approval of the editor. In this way, despite the existence of unedited new chapters, the editors can still ensure the correctness of the book project at any time. Editors can view previously edited chapters and recently submitted chapters.

The level at which the transaction is prepared to accept inconsistent data is called the isolation level. The isolation level is the degree to which a transaction must be isolated from other transactions. Low isolation levels can increase concurrency, but the cost is to reduce data correctness. On the contrary, high isolation levels can ensure data correctness, but may have a negative impact on concurrency. ApplicationProgramThe required isolation level determines the locking behavior used by SQL Server.

SQL-92 defines the following four isolation levels,

SQL Server supports all these isolation levels:
Uncommitted read (the lowest level of transaction isolation, can only ensure that the data is not read physically corrupt ).
Commit read (SQL Server default level ).
Repeatable read.
Serializable read (the highest level of transaction isolation, full isolation between transactions ).
If the transaction runs at the serializable read isolation level, it can ensure that any concurrent overlapping transactions are serialized.
The following four isolation levels allow different types of behavior.

Isolation level Dirty read Cannot be read repeatedly Phantom
Uncommitted read Yes Yes Yes
Submit read No Yes Yes
Repeatable read No No Yes
Serializable read No No No

the transaction must run at a Repeatable read or higher isolation level to prevent loss of updates. When two transactions retrieve the same row and then update the row based on the original retrieval value, the update will be lost. If two transactions use an update statement to update rows and do not update the rows based on the previously retrieved values, the update will not be lost at the default committed read isolation level.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.