Laravel 嵌套事务 transactions
前言
- 前言
- laravel 嵌套事务 transactions 实现
-
- 调用示例:
- 代码分析:
- 总结:
关于 mysql 的事务嵌套可以查看这个地址: https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html
里面有这么一句话
Transactions cannot be nested. This is a consequence of the implicit commit performed for any current transaction when you issue a START TRANSACTION statement or one of its synonyms.
大体意思是 db 不支持事务嵌套,如果你嵌套执行 START TRANSACTION 时会隐式执行 commit
我们做个测试:
mysql> BEGIN;
Query OK