数据库事务的隔离级共有4个

低到高的程序为

1、Read uncommitted (读未提交)
2、Read committed (读已提交)
3、Repeatable read (可反复读)
4、Serializable (序列化)

这四个级别能够一一解决 脏读、不可反复读、幻读这几类问题。

看看事务隔离级别,别离呈现的问题状况。 (✔: 可能呈现 ✘: 不会呈现)

脏读不可反复读幻读
Read uncommitted
Read committed
Repeatable read
Serializable

模仿并发场景,以上事隔离级别呈现的问题场景

  1. Read uncommitted (读未提交)