Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果目前我在任何交易中,有什么办法可以得到?例如:获取 MySqli::autocommit 是 'on' 还是 'off'?
需要这个,因为我的项目正在使用 memcache,它应该只在所有事务成功后更新。我想断言用户在任何事务的过程中都没有调用更新缓存方法。
提前致谢!
没有一种万无一失的方法可以确定事务是否已启动,因为即使您通常使用 MySqli::autocommit 来启动事务,也总有人可以发出 SQL 来启动事务。在这里查看答案:
如何检测该事务已经开始?