Class I, level Two, Level three lockdown protocol

Source: Internet
Author: User
        When using X-locks and S-Locks to lock data objects, there are rules that need to be agreed, such as when to apply for X-lock or S-lock, lock-in time, when to release, and so on. These rules are called the blockade Agreement (Locking Protocol). The different rules governing the way in which closures are imposed have created different kinds of blockade agreements. Different blocking protocols provide certain guarantees for the correct scheduling of concurrent operations at different levels.
一、一级 Blockade protocol
the first-level blocking protocol is that transaction T must be X-locked before the data R is modified until the end of the transaction is released. The end of the transaction consists of a normal end (COMMIT) and an abnormal end (ROLLBACK).
A first-level blocking protocol prevents loss of modification and guarantees that transaction T is recoverable. You can use the first-level blocking protocol to resolve lost modification issues.
in the first-level blocking protocol, if only the read data does not modify it, it does not need to be locked, it does not guarantee repeatable read and do not read "dirty" data.
二、二级 Blocking protocol
level Two blocking protocol is: first-class blocking protocol plus transaction T before reading the data r must be added s lock, read the rear can release S lock.
the level Two blocking protocol prevents the loss of modifications and further prevents the reading of "dirty" data. However, in the level two blocking protocol, the S lock can be released after reading the data, so it cannot guarantee repeatable reads.
三、三级 Blocking protocol
level Three blocking protocol is: first level blocking protocol plus transaction T before reading the data r must lock it before it is released until the end of the transaction. The
level Three lockdown protocol prevents non-repeatable reads, in addition to preventing loss of modification and non-reading of "dirty" data.
The main difference between the above level three protocol is what operations need to apply for blocking and when to release.                      
Resources:
http://zhidao.baidu.com/question/29901226
http://e-learning.zjgsu.edu.cn/moodle/mod/resource/view.php?inpopup=true&id=596
Http://202.207.137.111/sjkwz/htm/8.3.htm
Http://course.cug.edu.cn/cug/database/netclass/CHAPT8/8.3/8.3.htm

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.