Shared Locks & Exclusive Locks

Source: Internet
Author: User

Shared lock "s lock"
Also known as read lock, if the transaction T on the data object a plus s lock, then transaction T can read a but can not modify a, other transactions can only be a plus s lock, but not x lock, until T release a on the S lock. This ensures that other transactions can read a, but cannot make any changes to a before T releases the S lock on a.

Exclusive lock "x lock"

Also known as write locks. If a transaction t is an X lock on a data object A, transaction t can read a or modify a, and the other transaction can no longer lock on a, until T releases the lock on A. This ensures that other transactions can no longer read and modify a when T releases a lock on a.

Above from: http://blog.csdn.net/yuwei19840916/article/details/3245107

Role:

Shared locks: Prevents data being read by the current transaction from being modified by other transactions.

Exclusive lock: Prevents data from being modified by the current transaction from being read by other transactions, preventing other transactions from reading dirty data.

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.