I am using phalcon to develop our backend supporting for a mobile application. Because of bugs in early phalcon version, we workaround by a solution is adding PURE query between Phalcon ORM code lines. Ex:
$transaction = $transactionManager->get();
$mysql = 'SELECT * FROM sale_invoice WHERE id = ? FOR UPDATE';
$query = self::getDb()->query($mysql, array($this->invoice_id));
$this->invoice = $query->fetch(\Phalcon\Db::FETCH_ASSOC);
if (!$this->invoice)
return false;
$this->order = SaleOrder::findFirst($this->invoice['order_id']);
It worked, but sometime we got some timeout request revelant to APIs added "SELECT...FOR UPDATE" by this way. Is there anybody has experience to work in this case?