本文整理匯總了PHP中Varien_Db_Adapter_Interface::rollBack方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Db_Adapter_Interface::rollBack方法的具體用法?PHP Varien_Db_Adapter_Interface::rollBack怎麽用?PHP Varien_Db_Adapter_Interface::rollBack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Db_Adapter_Interface
的用法示例。
在下文中一共展示了Varien_Db_Adapter_Interface::rollBack方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* Method deletes old row in the mview table and insert new one from view.
*
* @return Enterprise_Mview_Model_Action_Mview_Create
* @throws Enterprise_Mview_Exception
*/
public function execute()
{
$this->_validate();
$this->_connection->beginTransaction();
try {
$this->_connection->delete($this->_metadata->getTableName(), array($this->_metadata->getKeyColumn() . '=?' => $this->_keyColumnIdValue));
$this->_connection->query($this->_getInsertSql());
$this->_connection->commit();
} catch (Exception $e) {
$this->_connection->rollBack();
throw new Enterprise_Mview_Exception($e->getMessage(), $e->getCode());
}
return $this;
}
示例2: execute
/**
* Refresh rows by ids from changelog
*
* @return Enterprise_Mview_Model_Action_Mview_Refresh_Changelog
* @throws Enterprise_Mview_Exception
*/
public function execute()
{
$this->_validate();
$this->_connection->beginTransaction();
try {
$this->_connection->delete($this->_metadata->getTableName(), array($this->_metadata->getKeyColumn() . ' IN ( ' . $this->_selectChangedIds() . ' )'));
$this->_connection->query($this->_connection->insertFromSelect($this->_selectChangedRows(), $this->_metadata->getTableName()));
$this->_metadata->setVersionId($this->_selectLastVersionId());
$this->_metadata->save();
$this->_connection->commit();
} catch (Exception $e) {
$this->_connection->rollBack();
$this->_metadata->setOutOfDateStatus()->save();
throw new Enterprise_Mview_Exception($e->getMessage(), $e->getCode());
}
return $this;
}