本文整理汇总了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;
}