示例#1
0
function gcms_rollback()
{
    global $gcms_trans_id;
    if ($gcms_trans_id) {
        ibase_rollback($gcms_trans_id);
    }
    $gcms_trans_id = false;
}
示例#2
0
文件: Driver.php 项目: reoring/sabel
 public function rollback()
 {
     if (ibase_rollback($this->connection)) {
         $this->autoCommit = true;
     } else {
         throw new Sabel_Db_Exception_Driver(ibase_errmsg());
     }
 }
示例#3
0
 /**
  * SQL Transaction
  * @access private
  */
 function _sql_transaction($status = 'begin')
 {
     switch ($status) {
         case 'begin':
             return true;
             break;
         case 'commit':
             return @ibase_commit();
             break;
         case 'rollback':
             return @ibase_rollback();
             break;
     }
     return true;
 }
示例#4
0
 function sql_transaction($status = 'begin')
 {
     switch ($status) {
         case 'begin':
             $this->transaction = true;
             break;
         case 'commit':
             $result = @ibase_commit();
             $this->transaction = false;
             if (!$result) {
                 @ibase_rollback();
             }
             break;
         case 'rollback':
             $result = @ibase_rollback();
             $this->transaction = false;
             break;
         default:
             $result = true;
     }
     return $result;
 }
示例#5
0
 public function transRollback()
 {
     return ibase_rollback($this->ibase_trans);
 }
示例#6
0
 /**
  * Rollback Transaction.
  *
  * @return bool
  */
 protected function _trans_rollback()
 {
     if (ibase_rollback($this->_ibase_trans)) {
         $this->_ibase_trans = null;
         return true;
     }
     return false;
 }
示例#7
0
 public function commit()
 {
     if (!$this->trans) {
         $this->result = ibase_commit($this->connection);
     } else {
         $this->result = ibase_rollback($this->trans);
         $this->trans = null;
     }
     if (!$this->result) {
         throw new Exception(ibase_errmsg());
     }
 }
 function RollbackTransaction($intTrans)
 {
     if ($this->intDebug) {
         echo "Rolling back transaction...\t <br>";
     }
     $this->intTrans = ibase_rollback($this->intTrans);
     $this->intTransStatus--;
     return $this->intQuery;
 }
示例#9
0
 /**
  * Reverts the current transaction
  *
  * @return int  DB_OK on success.  A DB_Error object on failure.
  */
 function rollback()
 {
     return @ibase_rollback($this->connection);
 }
示例#10
0
 /**
 +----------------------------------------------------------
 * 事务回滚
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @return boolen
 +----------------------------------------------------------
 * @throws ThinkExecption
 +----------------------------------------------------------
 */
 public function rollback()
 {
     if ($this->transTimes > 0) {
         $result = ibase_rollback($this->_linkID);
         $this->transTimes = 0;
         if (!$result) {
             throw_exception($this->error());
         }
     }
     return true;
 }
示例#11
0
 /**
  * Rollback Transaction
  *
  * @return	bool
  */
 public function trans_rollback()
 {
     // When transactions are nested we only begin/commit/rollback the outermost ones
     if (!$this->trans_enabled or $this->_trans_depth > 0) {
         return TRUE;
     }
     return ibase_rollback($this->_ibase_trans);
 }
示例#12
0
 /**
  * 事务回滚
  * @access public
  * @return boolen
  */
 public function rollback()
 {
     if ($this->transTimes > 0) {
         $result = ibase_rollback($this->_linkID);
         $this->transTimes = 0;
         if (!$result) {
             $this->error();
             return false;
         }
     }
     return true;
 }
        if ($_REQUEST['spt'] == '') {
            $exception = array('spt_id', 'nama_kegiatan');
            $other_request = array('pendataan_id' => $ID_HEADER, 'pendataan_no' => $no_spt, 'jenis_pendataan' => 'LISTRIK');
        } else {
            $exception = array('nama_kegiatan');
            $other_request = array('pendataan_id' => $ID_HEADER, 'pendataan_no' => $no_spt, 'jenis_pendataan' => 'LISTRIK', 'spt_id' => $_REQUEST['spt']);
        }
        ibase_trans();
        $a = $fbird->FBInsert('pendataan_spt', $other_request, $exception);
        unset($exception);
        unset($other_request);
        if ($a) {
            $ID_CONTENT = $fbird->setGenerator('GEN_PENDATAAN_LISTRIK');
            $exception = array();
            $other_request = array('listrik_id' => $ID_CONTENT, 'pendataan_id' => $ID_HEADER, 'id_rekening' => $_REQUEST['rekening']);
            $b = $fbird->FBInsert('pendataan_listrik', $other_request, $exception);
            unset($exception);
            unset($other_request);
            if ($b) {
                ibase_commit();
                echo 'Data Telah Tersimpan';
            } else {
                ibase_rollback();
                echo 'Gagal Di Content';
            }
        } else {
            ibase_rollback();
            echo 'Gagal d Header ';
        }
    }
}
示例#14
0
 function trans($action, $transID = null)
 {
     //action = begin, commit oder rollback
     if ($action == 'begin') {
         $this->transID = ibase_trans($this->linkId);
         return $this->transID;
     }
     if ($action == 'commit' and !empty($this->transID)) {
         ibase_commit($this->linkId, $this->transID);
     }
     if ($action == 'rollback') {
         ibase_rollback($this->linkId, $this->transID);
     }
 }
    protected function rollbackTransacao($transacao) {
	return ibase_rollback($transacao);
    }
示例#16
0
 /**
  * Envoie une commande ROLLBACK à la base de données pour annulation de la
  * transaction courante
  * 
  * @access public
  * @return boolean
  */
 function rollBack()
 {
     $this->autocommit = true;
     return ibase_rollback($this->link);
 }
示例#17
0
 function _performRollback()
 {
     return ibase_rollback($this->trans);
 }
 /**
  * Cancel any database changes done during a transaction that is in
  * progress. This function may only be called when auto-committing is
  * disabled, otherwise it will fail. Therefore, a new transaction is
  * implicitly started after canceling the pending changes.
  *
  * @return mixed MDB_OK on success, a MDB error on failure
  * @access public
  */
 function rollback()
 {
     $this->debug('Rollback Transaction');
     if ($this->auto_commit) {
         return $this->raiseError(MDB_ERROR, NULL, NULL, 'Rollback: transactions can not be rolled back when changes are auto commited');
     }
     //return ibase_rollback($this->connection);
     if ($this->transaction_id && !@ibase_rollback($this->connection)) {
         return $this->raiseError(MDB_ERROR, NULL, NULL, 'Rollback: Could not rollback a pending transaction: ' . @ibase_errmsg());
     }
     if (!($this->transaction_id = @ibase_trans(IBASE_COMMITTED, $this->connection))) {
         return $this->raiseError(MDB_ERROR, NULL, NULL, 'Rollback: Could not start a new transaction: ' . @ibase_errmsg());
     }
     return MDB_OK;
 }
示例#19
0
 /**
  * Rollback changes in a transaction.
  * @param  string  optional savepoint name
  * @return void
  * @throws DibiDriverException
  */
 public function rollback($savepoint = NULL)
 {
     if ($savepoint !== NULL) {
         throw new DibiNotSupportedException('Savepoints are not supported in Firebird/Interbase.');
     }
     if (!ibase_rollback($this->transaction)) {
         throw new DibiDriverException('Unable to handle operation - failure when rolbacking transaction.');
     }
     $this->inTransaction = FALSE;
 }
示例#20
0
 /**
  * This function rollbacks a transaction.
  *
  * @access public
  * @override
  * @throws Throwable_SQL_Exception              indicates that the executed
  *                                              statement failed
  */
 public function rollback()
 {
     if (!$this->is_connected()) {
         throw new Throwable_SQL_Exception('Message: Failed to rollback SQL transaction. Reason: Unable to find connection.');
     }
     $command = @ibase_rollback($this->resource);
     if ($command === FALSE) {
         throw new Throwable_SQL_Exception('Message: Failed to rollback SQL transaction. Reason: :reason', array(':reason' => @ibase_errmsg()));
     }
     $this->sql = 'ROLLBACK;';
 }
示例#21
0
文件: ibase.php 项目: Dulciane/jaws
 /**
  * Cancel any database changes done during a transaction or since a specific
  * savepoint that is in progress. This function may only be called when
  * auto-committing is disabled, otherwise it will fail. Therefore, a new
  * transaction is implicitly started after canceling the pending changes.
  *
  * @param   string  name of a savepoint to rollback to
  * @return  mixed   MDB2_OK on success, a MDB2 error on failure
  *
  * @access  public
  */
 function rollback($savepoint = null)
 {
     $this->debug('Rolling back transaction/savepoint', __FUNCTION__, array('is_manip' => true, 'savepoint' => $savepoint));
     if (!$this->in_transaction) {
         return $this->raiseError(MDB2_ERROR_INVALID, null, null, 'rollback cannot be done changes are auto committed', __FUNCTION__);
     }
     if (null !== $savepoint) {
         $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint;
         return $this->_doQuery($query, true);
     }
     if ($this->transaction_id && !@ibase_rollback($this->transaction_id)) {
         return $this->raiseError(null, null, null, 'Could not rollback a pending transaction: ' . @ibase_errmsg(), __FUNCTION__);
     }
     $this->in_transaction = false;
     $this->transaction_id = 0;
     return MDB2_OK;
 }
示例#22
0
 /**
  * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
  *
  * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
  **/
 function _getNavigationData($table_list, $columns, $left_join, $condition, $output)
 {
     require_once _XE_PATH_ . 'classes/page/PageHandler.class.php';
     $query_groupby = '';
     if ($output->groups) {
         foreach ($output->groups as $key => $val) {
             $group_list[] = $this->autoQuotes($val);
         }
         if (count($group_list)) {
             $query_groupby = sprintf(" GROUP BY %s", implode(", ", $group_list));
         }
     }
     /*
     // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정
     // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다.
     //
     $count_condition = strlen($query_groupby) ? sprintf('%s group by %s', $condition, $query_groupby) : $condition;
     $total_count = $this->getCountCache($output->tables, $count_condition);
     if($total_count === false) {
         $count_query = sprintf('select count(*) as "count" from %s %s %s', implode(', ', $table_list), implode(' ', $left_join), $count_condition);
         if (count($output->groups))
             $count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query);
         $result = $this->_query($count_query);
         $count_output = $this->_fetch($result);
         $total_count = (int)$count_output->count;
         $this->putCountCache($output->tables, $count_condition, $total_count);
     }
     */
     // 전체 개수를 구함
     $count_query = sprintf("select count(*) as \"count\" from %s %s %s", implode(',', $table_list), implode(' ', $left_join), $condition);
     $total_count = $this->getCountCache($output->tables, $condition);
     if ($total_count === false) {
         $result = $this->_query($count_query);
         $count_output = $this->_fetch($result);
         if (!$this->transaction_started) {
             @ibase_commit($this->fd);
         }
         $total_count = (int) $count_output->count;
         $this->putCountCache($output->tables, $condition, $total_count);
     }
     $list_count = $output->list_count['value'];
     if (!$list_count) {
         $list_count = 20;
     }
     $page_count = $output->page_count['value'];
     if (!$page_count) {
         $page_count = 10;
     }
     $page = $output->page['value'];
     if (!$page) {
         $page = 1;
     }
     // 전체 페이지를 구함
     if ($total_count) {
         $total_page = (int) (($total_count - 1) / $list_count) + 1;
     } else {
         $total_page = 1;
     }
     // 페이지 변수를 체크
     if ($page > $total_page) {
         $page = $total_page;
     }
     $start_count = ($page - 1) * $list_count;
     // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
     if ($output->order) {
         $conditions = $this->getConditionList($output);
         if (!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
             foreach ($output->order as $key => $val) {
                 $col = $val[0];
                 if (!in_array($col, array('list_order', 'update_order'))) {
                     continue;
                 }
                 if ($condition) {
                     $condition .= sprintf(' and "%s" < 2100000000 ', $col);
                 } else {
                     $condition = sprintf(' where "%s" < 2100000000 ', $col);
                 }
             }
         }
     }
     $limit = sprintf('FIRST %d SKIP %d ', $list_count, $start_count);
     $query = sprintf('SELECT %s %s FROM %s %s %s', $limit, $columns, implode(',', $table_list), implode(' ', $left_join), $condition);
     if (strlen($query_groupby)) {
         $query .= $query_groupby;
     }
     if ($output->order) {
         foreach ($output->order as $key => $val) {
             $index_list[] = sprintf("%s %s", $this->autoQuotes($val[0]), $val[1]);
         }
         if (count($index_list)) {
             $query .= sprintf(" ORDER BY %s", implode(",", $index_list));
         }
     }
     $query .= ";";
     $result = $this->_query($query);
     if ($this->isError()) {
         if (!$this->transaction_started) {
             @ibase_rollback($this->fd);
         }
         $buff = new Object();
         $buff->total_count = 0;
         $buff->total_page = 0;
         $buff->page = 1;
         $buff->data = array();
         $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
         return $buff;
     }
     $virtual_no = $total_count - ($page - 1) * $list_count;
     while ($tmp = ibase_fetch_object($result)) {
         foreach ($tmp as $key => $val) {
             $type = $output->column_type[$key];
             if ($type == null) {
                 foreach ($output->columns as $cols) {
                     if ($cols['alias'] == $key) {
                         $type = $output->column_type[$cols['name']];
                     }
                 }
             }
             if ($type == "text" || $type == "bigtext") {
                 $blob_data = ibase_blob_info($tmp->{$key});
                 $blob_hndl = ibase_blob_open($tmp->{$key});
                 $tmp->{$key} = ibase_blob_get($blob_hndl, $blob_data[0]);
                 ibase_blob_close($blob_hndl);
             }
         }
         $data[$virtual_no--] = $tmp;
     }
     if (!$this->transaction_started) {
         @ibase_commit($this->fd);
     }
     $buff = new Object();
     $buff->total_count = $total_count;
     $buff->total_page = $total_page;
     $buff->page = $page;
     $buff->data = $data;
     $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
     return $buff;
 }
示例#23
0
文件: Ibase.php 项目: saqar/tc_aowow
 function _performRollback()
 {
     if (!is_resource($this->trans)) {
         return false;
     }
     $result = @ibase_rollback($this->trans);
     if (true === $result) {
         $this->trans = null;
     }
     return $result;
 }
示例#24
0
 /**
  * Roll-back a transaction.
  *
  * @return void
  */
 protected function _rollBack()
 {
     if (!ibase_rollback(is_resource($this->_transResource) ? $this->_transResource : $this->_connection)) {
         /**
          * @see Zend_Db_Adapter_Firebird_Exception
          */
         require_once 'Zend/Db/Adapter/Firebird/Exception.php';
         throw new Zend_Db_Adapter_Firebird_Exception(ibase_errmsg());
     }
     $this->_transResource = null;
 }
示例#25
0
 /**
  * Rollback Transaction
  *
  * @return	bool
  */
 protected function _trans_rollback()
 {
     if (ibase_rollback($this->_ibase_trans)) {
         $this->_ibase_trans = NULL;
         return TRUE;
     }
     return FALSE;
 }
示例#26
0
 /**
  * @see ILumine_Connection::rollback()
  */
 public function rollback($transactionID = null)
 {
     if (is_null($transactionID)) {
         $id = $this->transactions_count - 1;
     } else {
         $id = $transactionID;
     }
     if (isset($this->transactions[$id])) {
         ibase_rollback($this->conn_id, $this->transactions[$id]);
         unset($this->transactions[$id]);
     }
 }
示例#27
0
 function RollbackTransaction()
 {
     $this->Debug("Rollback Transaction");
     if ($this->auto_commit) {
         return $this->SetError("Rollback transaction", "transactions can not be rolled back when changes are auto commited");
     }
     if ($this->transaction_id && !ibase_rollback($this->transaction_id)) {
         return $this->SetError("Rollback transaction", "Could not rollback a pending transaction: " . ibase_errmsg());
     }
     if (!($this->transaction_id = ibase_trans(IBASE_COMMITTED, $this->connection))) {
         return $this->SetError("Rollback transaction", "Could start a new transaction: " . ibase_errmsg());
     }
     return 1;
 }
示例#28
0
 function rollback($trans_number)
 {
     return ibase_rollback($this->connection, $trans_number);
 }
示例#29
0
 function _close()
 {
     if (!$this->autoCommit) {
         @ibase_rollback($this->_connectionID);
     }
     return @ibase_close($this->_connectionID);
 }
 /**
  * Rollback Transaction
  *
  * @access	public
  * @return	bool
  */
 function trans_rollback()
 {
     if (!$this->trans_enabled) {
         return TRUE;
     }
     // When transactions are nested we only begin/commit/rollback the outermost ones
     if ($this->_trans_depth > 0) {
         return TRUE;
     }
     return @ibase_rollback($this->conn_id);
 }