Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

采用分布式数据库时,开始事务后,使用Db::query()时会转到从库 #24

Closed
easytzb opened this issue Jan 18, 2013 · 1 comment

Comments

@easytzb
Copy link
Contributor

easytzb commented Jan 18, 2013

$model->startTrans();
$data = $model->lock(true)->where('id=' . $dataId)->find();
...

关键代码如下:
public function query($str) {
$this->initConnect(false);
if ( !$this->_linkID ) return false;
...

@liu21st
Copy link
Member

liu21st commented Jan 18, 2013

query方法本来就是读操作 execute方法才是写操作。

@liu21st liu21st closed this as completed Jan 18, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants