Lock and transaction isolation level in Mysql Innodb

Read Uncommitted

At this level, the database is generally not used, and any operation will not be locked

Read Committed

The reading of data is not locked, but the writing, modification and deletion of data need to be locked.

Repeatable Read

read

  • Snapshot read
    • select * from xxxxxx

Reading the data in the snapshot does not affect the current transaction when all other transactions commit

  • current reading
    • select * form table where for update
    • select * from table where ? lock in share mode
    • insert
    • update
    • delete

Write

lock

Serializable

Read plus shared lock, write plus exclusive lock

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326408958&siteId=291194637