The difference between a read lock and a write lock

Source: Internet
Author: User
A shared lock (S lock) is also called a read lock, and if the transaction T is a plus s lock on the data object A, the transaction T can read a but cannot modify a, and the other transaction can only have a plus s lock, not the x lock, until T releases the 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.
An exclusive lock (x Lock) is also called a 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.

The difference between a read lock and a write 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.