Two types of missing updates

Source: Internet
Author: User

Category 1 lost updates

When transaction A is canceled, the updated data of transaction B that has been committed is overwritten. This error may cause serious problems. You can see it through the following account withdrawal transfer:

Time Withdrawal transaction Transfer transaction B
T1 Start transaction  
T2   Start transaction
T3 The account balance is USD 1000.  
T4   The account balance is USD 1000.
T5   Remit 100 yuan to change the balance to 1100 yuan
T6   Commit transactions
T7 Retrieve 100 yuan and change the balance to 900 yuan  
T8 Cancel transaction  
T9 Balance restored to 1000
Metadata (lost updates)
 


When transaction A revokes the transaction, it accidentally erased the amount that transaction B has transferred to the Account.
Type 2 lost updates
Transaction A overwrites the data already submitted by transaction B, resulting in the loss of operations performed by transaction B:

Time Transfer transaction Withdrawal transaction B
T1   Start transaction
T2 Start transaction
T3 The account balance is USD 1000.
T4 The account balance is USD 1000.
T5   Retrieve 100 yuan and change the balance to 900 yuan
T6   Commit transactions
T7 Import 100 RMB  
T8 Commit transactions  
T9 Change balance to 1100
Metadata (lost updates)
 


In the above example, the check transfer transaction overwrites the withdrawal transaction's updates to the deposit balance, resulting in the Bank's final loss of 100 yuan. On the contrary, if the transfer transaction is committed first, the user account will lose 100 yuan.

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.