commitDbTransaction() 공개 메소드

Commits the transaction (and turns on auto-committing).
public commitDbTransaction ( )
예제 #1
0
파일: Sql.php 프로젝트: jubinpatel/horde
 /**
  * Removes a group.
  *
  * @param mixed $gid  A group ID.
  *
  * @throws Horde_Group_Exception
  */
 public function remove($gid)
 {
     try {
         $this->_db->beginDbTransaction();
         $this->_db->delete('DELETE FROM horde_groups_members WHERE group_uid = ?', array($gid));
         $this->_db->delete('DELETE FROM horde_groups WHERE group_uid = ?', array($gid));
         $this->_db->commitDbTransaction();
     } catch (Horde_Db_Exception $e) {
         throw new Horde_Group_Exception($e);
     }
 }
예제 #2
0
파일: Sql.php 프로젝트: raz0rsdge/horde
 /**
  */
 public function destroy($id)
 {
     /* Build the SQL query. */
     $query = sprintf('DELETE FROM %s WHERE session_id = ?', $this->_params['table']);
     $values = array($id);
     /* Execute the query. */
     try {
         $this->_db->delete($query, $values);
         $this->_db->commitDbTransaction();
     } catch (Horde_Db_Exception $e) {
         return false;
     }
     return true;
 }
예제 #3
0
파일: Sql.php 프로젝트: jubinpatel/horde
 /**
  */
 public function removeAllVersions($pagename)
 {
     /* Remove attachments and do other cleanup. */
     parent::removeAllVersions($pagename);
     $this->_pageNames = null;
     try {
         $this->_db->beginDbTransaction();
         $this->_db->delete('DELETE FROM ' . $this->_params['table'] . ' WHERE page_name = ?', array($this->_convertToDriver($pagename)));
         $this->_db->delete('DELETE FROM ' . $this->_params['historytable'] . ' WHERE page_name = ?', array($this->_convertToDriver($pagename)));
         $this->_db->commitDbTransaction();
     } catch (Horde_Db_Exception $e) {
         $this->_db->rollbackDbTransaction();
         throw new Wicked_Exception($e);
     }
 }
예제 #4
0
파일: Sql.php 프로젝트: jubinpatel/horde
 /**
  */
 public function sort($rules)
 {
     $old = $this->_filters;
     parent::sort($rules);
     $query = sprintf('UPDATE %s SET rule_order = ? WHERE rule_id = ?', $this->_params['table_rules']);
     $this->_db->beginDbTransaction();
     try {
         foreach ($this->_filters as $key => $val) {
             $this->_db->update($query, array($key, $val['id']));
         }
     } catch (Horde_Db_Exception $e) {
         $this->_db->rollbackDbTransaction();
         $this->_filters = $old;
         throw new Ingo_Exception($e);
     }
     $this->_db->commitDbTransaction();
 }
예제 #5
0
파일: SplitRead.php 프로젝트: horde/horde
 /**
  * Commits the transaction (and turns on auto-committing).
  */
 public function commitDbTransaction()
 {
     $result = $this->_write->commitDbTransaction();
     $this->_lastQuery = $this->_write->getLastQuery();
     return $result;
 }