Home  >  Article  >  Backend Development  >  thinkphp 开启主从的事务有关问题

thinkphp 开启主从的事务有关问题

WBOY
WBOYOriginal
2016-06-13 12:11:311096browse

thinkphp 开启主从的事务问题
手册中,开启主从query会走从库。
而事务中,期望的是所有操作都在主库上进行。
一个事务中,需要query查询出数据,经过计算,再保存到数据库中。
这样会不会导致query时候查询的是从库,而计算保存的在主库。
导致参与计算的数据有误。

难道只能自己重写一个db类?
------解决思路----------------------
主从会做数据同步的

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn