开启事务后,按照文档说的参数"for_update" => true来查询就报错syntax error, unexpected token identifier(for), near to ' update'
$this->db->begin();
$robots = Robots::find(array(
"conditions" => "name LIKE %steve%",
"order" => "name",
"for_update" => true
));
...
$this->db->commit();
phalcon版本1.3.4
求证,你们的phalcon使用行锁for_upade会报错吗?还是我的代码不对?
http://www.myleftstudio.com/reference/models.html#finding-records
开启事务后,按照文档说的参数"for_update" => true来查询就报错syntax error, unexpected token identifier(for), near to ' update'
$this->db->begin();
$robots = Robots::find(array(
"conditions" => "name LIKE %steve%",
"order" => "name",
"for_update" => true
));
...
$this->db->commit();
phalcon版本1.3.4
求证,你们的phalcon使用行锁for_upade会报错吗?还是我的代码不对?
http://www.myleftstudio.com/reference/models.html#finding-records
是的,phalcon 1.3.X都有这个问题,应该是在今年6月份的时候phalcon 2.0.4解决了这个bug
解决办法,用最新的phalcon,或者使用pdo执行纯sql
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号