Database Consistency Note

Source: Internet
Author: User

1. mysql different storage engine supports different lock mechanism

Talking about MySQL's Storage engine (table type)

2, MySQL lock detailed

MySQL Details--lock

MySQL locking mechanism introduction Here's a good explanation of the INNODB locking mechanism example!

Original: http://www.cnblogs.com/ggjucheng/archive/2012/11/14/2770445.html

Summary:

"In the transaction management and locking mechanism of INNODB, there is a mechanism for detecting deadlocks that detects the existence of a damn lock within a short period of time after a deadlock is generated in the system."

When InnoDB detects that a deadlock has been generated in the system, InnoDB will choose to roll back the smaller transactions in the two transactions that generated the deadlock by the appropriate decision, allowing the other larger transaction to complete successfully.

One thing to note, though, is that when there are more than InnoDB storage engines involved in a deadlock scenario, InnoDB is not able to detect a damn lock, which can only be solved by locking the timeout limit.

MySQL Deadlock exception tip: [ERR] 1213-deadlock found when trying to get lock; Try restarting transaction

In layman's MySQL transaction processing and locking mechanism

MYSQL Get_lock and Release_lock ()

3, using the lock in Share mode implementation, repeatable read.

4, in some cases can use Get_lock, release_lock to advise the lock, avoid deadlock, improve database performance

Database Consistency Note

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.