Skip to content

Commit 46f40ec

Browse files
committed
Update takeout
1 parent f8c51bd commit 46f40ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

content/post/Learn/Sky-Takeout/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ categories:
126126
2. 在需要使用的 Mapper 接口加上 `@AutoFill(value = OperationType.<INSERT/UPDATE>)` 注解,
127127
3. 调用时自动实现公共字段自动填充
128128

129+
#### 声明式事务
130+
131+
- 问题:当遇到需要操作多个表的任务时,如用户下单时先往 `orders` 表插入一条数据,然后往 `order_detail` 中插入多条数据。这时如果操作在第二步遇到错误,无法完成,会导致数据“缺胳膊少腿”
132+
- 解决:利用事务注解 `@Transactional` 将操作原子化,使之不可分割。当在操作中途遇到错误时,会回滚到操作开始前的状态。
133+
129134
#### 微信支付 mock
130135

131136
- 问题:个人认证小程序无法使用支付功能,故无法完成需要订单提交功能的软件测试

0 commit comments

Comments
 (0)