The difference between a database optimistic lock and a pessimistic

Source: Internet
Author: User

1: Update, delete operations on the same resource for multiple users

2: Two kinds of locks are when the data resource operation conflict, and finally due to the reason of the lock, to ensure that the resources are not chaotic.
Optimistic Lock: Allows multiple people to operate a record at the same time, who commits first, records change to WHO, subsequent submissions fail
Pessimistic lock: Allows a person to operate a single resource, who first comes in, who first occupies resources. The need to wait for subsequent access

3: Pessimistic locking requires a persistent database connection, which is virtually nonexistent in today's Web applications

4: The emergence of an optimistic lock is a solution to maintain data accuracy in a short-term web-like business

The difference between a database optimistic lock and a pessimistic

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.