auto commit
This commit is contained in:
parent
d7920b50bd
commit
bacf789b73
|
@ -47,7 +47,7 @@
|
|||
|
||||
事务指的是满足 ACID 特性的一组操作,可以通过 Commit 提交一个事务,也可以使用 Rollback 进行回滚。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207175048914.png"/> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205825456.png"/> </div><br>
|
||||
|
||||
## ACID
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
|||
- 在并发的情况下,多个事务并行执行,事务不仅要满足原子性,还需要满足隔离性,才能满足一致性。
|
||||
- 事务满足持久化是为了能应对数据库崩溃的情况。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207175109320.png"/> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205737391.png"/> </div><br>
|
||||
|
||||
## AUTOCOMMIT
|
||||
|
||||
|
@ -94,13 +94,13 @@ MySQL 默认采用自动提交模式。也就是说,如果不显式使用`STAR
|
|||
|
||||
T<sub>1</sub> 和 T<sub>2</sub> 两个事务都对一个数据进行修改,T<sub>1</sub> 先修改,T<sub>2</sub> 随后修改,T<sub>2</sub> 的修改覆盖了 T<sub>1</sub> 的修改。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/75184b58-c627-4edc-8dcf-605762ebb733.png" width="320px"> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205105044.png"/> </div><br>
|
||||
|
||||
## 读脏数据
|
||||
|
||||
T<sub>1</sub> 修改一个数据,T<sub>2</sub> 随后读取这个数据。如果 T<sub>1</sub> 撤销了这次修改,那么 T<sub>2</sub> 读取的数据是脏数据。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/af0e94d9-502d-4531-938f-d46dd29de52d.png" width="360px"> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205339747.png"/> </div><br>
|
||||
|
||||
## 不可重复读
|
||||
|
||||
|
|
BIN
notes/pics/image-20191207180652772.png
Normal file
BIN
notes/pics/image-20191207180652772.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
notes/pics/image-20191207180710529.png
Normal file
BIN
notes/pics/image-20191207180710529.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
notes/pics/image-20191207205105044.png
Normal file
BIN
notes/pics/image-20191207205105044.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
notes/pics/image-20191207205339747.png
Normal file
BIN
notes/pics/image-20191207205339747.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
BIN
notes/pics/image-20191207205737391.png
Normal file
BIN
notes/pics/image-20191207205737391.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
notes/pics/image-20191207205825456.png
Normal file
BIN
notes/pics/image-20191207205825456.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
|
@ -47,7 +47,7 @@
|
|||
|
||||
事务指的是满足 ACID 特性的一组操作,可以通过 Commit 提交一个事务,也可以使用 Rollback 进行回滚。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207175048914.png"/> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205825456.png"/> </div><br>
|
||||
|
||||
## ACID
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
|||
- 在并发的情况下,多个事务并行执行,事务不仅要满足原子性,还需要满足隔离性,才能满足一致性。
|
||||
- 事务满足持久化是为了能应对数据库崩溃的情况。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207175109320.png"/> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205737391.png"/> </div><br>
|
||||
|
||||
## AUTOCOMMIT
|
||||
|
||||
|
@ -94,13 +94,13 @@ MySQL 默认采用自动提交模式。也就是说,如果不显式使用`STAR
|
|||
|
||||
T<sub>1</sub> 和 T<sub>2</sub> 两个事务都对一个数据进行修改,T<sub>1</sub> 先修改,T<sub>2</sub> 随后修改,T<sub>2</sub> 的修改覆盖了 T<sub>1</sub> 的修改。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/75184b58-c627-4edc-8dcf-605762ebb733.png" width="320px"> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205105044.png"/> </div><br>
|
||||
|
||||
## 读脏数据
|
||||
|
||||
T<sub>1</sub> 修改一个数据,T<sub>2</sub> 随后读取这个数据。如果 T<sub>1</sub> 撤销了这次修改,那么 T<sub>2</sub> 读取的数据是脏数据。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/af0e94d9-502d-4531-938f-d46dd29de52d.png" width="360px"> </div><br>
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/image-20191207205339747.png"/> </div><br>
|
||||
|
||||
## 不可重复读
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user