Shared lock "s lock" exclusive lock "x lock"

Source: Internet
Author: User
The exclusive lock is also called the Write lock ((eXclusive lock, précis-writers is the x lock), if the transaction T to the data object a plus x lock, then only allow T to read and modify a, no other transaction can be a plus any type of lock, until T release the lock on A. It prevents any other transaction from acquiring a lock on the resource until the original lock on the resource is released at the end of the transaction. An exclusive lock is always applied during an update operation (INSERT, update, or DELETE). The difference between a shared lock: A shared lock is also called a read lock (Share lock, précis-writers is a s lock), and if the transaction T is a plus s lock on the data object A, the other transaction can only be locked to a plus s, not the x lock, until T releases the S lock on a.

Shared lock "s lock"
Also called a read lock, if the transaction T with the data object a plus s lock, then the transaction T can read a but cannot modify a, the other transaction can only a plus s lock, and cannot add x lock, until T release S lock on A. This ensures that other transactions can read a, but cannot make any modifications to a before T releases the S lock on a.

Exclusive lock "x lock"
Also known as write lock. If the transaction t has an X lock on the data object A, the transaction T can read a or modify a, and the other transaction cannot add any locks to a, until T releases the lock on A. This ensures that the other transaction cannot read and modify a until the lock on the A is released by T.

Shared lock "s lock" exclusive lock "x lock"

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.