Skip to content

Commit 0779627

Browse files
committed
修正格式
1 parent bf279ce commit 0779627

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Course4/database_transaction.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ START TRANSACTION;
212212
COMMIT;
213213
```
214214

215-
2. 如果不允许超卖的话,则在事务的过程中,注意事务还未结束,检查quantity是小于0, 小于0则说明超卖了,立即回滚事务,撤销当前的订单。
215+
2. 如果不允许超卖的话,则在事务的过程中,注意事务还未结束,检查quantity是否小于0, 小于0则说明超卖了,立即回滚事务,撤销当前的订单。
216216

217+
```
217218
select quantity from inventory_test where product_id=1
218219
219220
if quantity <0 {
@@ -222,7 +223,7 @@ if quantity <0 {
222223
else {
223224
COMMIT;
224225
}
225-
226+
```
226227

227228
### 6.3 总结
228229

Course4/saga.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
### 2.2 CAP理论
1717

18-
## 3. 什么是[Sage模式](http://microservices.io/ patterns/data/saga.html)?
18+
## 3. 什么是[Saga模式](http://microservices.io/ patterns/data/saga.html)?
1919

2020
基于异步消息,协调一系列本地事务,以保证数据最终一次性。
2121

@@ -32,13 +32,13 @@
3232

3333
## 如何实现“隔离性”?
3434

35-
* 在跨服务,没有数据库事务的情况,我们在微服务系统要面临:
35+
在跨服务,没有数据库事务的情况,我们在微服务系统要面临:
3636

3737
* 更新丢失
3838
* 脏读
3939
* 不可重复读
4040

41-
* 解决方法
41+
解决方法
4242

4343
* 语义化版本锁(Semantic lock)— 应用层锁
4444
* 可交换更新(Commutative updates)—Design update operations to be executable in any order.

0 commit comments

Comments
 (0)