예제 #1
0
파일: Ibase.php 프로젝트: space77/mwfv3_sp
 function _performTransaction($parameters = null)
 {
     if ($parameters === null) {
         $parameters = $this->bestTrans;
     }
     $this->trans = ibase_trans($parameters, $this->link);
 }
예제 #2
0
function gcms_trans()
{
    global $fbdb, $gcms_trans_id;
    if (!$gcms_trans_id) {
        $gcms_trans_id = ibase_trans(IBASE_COMMITTED, $fbdb);
    }
}
예제 #3
0
파일: Ibase.php 프로젝트: saqar/tc_aowow
 function _performTransaction($parameters = null)
 {
     if ($parameters === null) {
         $parameters = $this->DbSimple_Ibase_BEST_TRANSACTION;
     }
     $this->trans = @ibase_trans($parameters, $this->link);
 }
예제 #4
0
	public function BeginTrans()
	{	 
		if ($this->transOff) return true;
		$this->transCnt += 1;
		$this->autoCommit = false;
	 	$this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID);
		return $this->_transactionID;
	}
예제 #5
0
 /**
  * This function begins a transaction.
  *
  * @access public
  * @override
  * @throws Throwable_SQL_Exception              indicates that the executed
  *                                              statement failed
  */
 public function begin_transaction()
 {
     if (!$this->is_connected()) {
         throw new Throwable_SQL_Exception('Message: Failed to begin SQL transaction. Reason: Unable to find connection.');
     }
     $command = @ibase_trans($this->resource, IBASE_READ | IBASE_WRITE);
     if ($command === FALSE) {
         throw new Throwable_SQL_Exception('Message: Failed to begin SQL transaction. Reason: :reason', array(':reason' => @ibase_errmsg()));
     }
     $this->sql = 'BEGIN TRANSACTION;';
 }
예제 #6
0
파일: Driver.php 프로젝트: reoring/sabel
 public function begin($isolationLevel = null)
 {
     if ($isolationLevel === null) {
         $this->isolationLevel = IBASE_WRITE | IBASE_COMMITTED | IBASE_REC_NO_VERSION | IBASE_WAIT;
     } else {
         $this->setTransactionIsolationLevel($isolationLevel);
     }
     $this->autoCommit = false;
     $this->connection = ibase_trans($this->isolationLevel, $this->connection);
     return $this->connection;
 }
예제 #7
0
 /**
  * Begins a transaction (if supported).
  * @param  string  optional savepoint name
  * @return void
  * @throws DibiDriverException
  */
 public function begin($savepoint = NULL)
 {
     if ($savepoint !== NULL) {
         throw new DibiNotSupportedException('Savepoints are not supported in Firebird/Interbase.');
     }
     $this->transaction = ibase_trans($this->resource);
     $this->inTransaction = TRUE;
 }
예제 #8
0
 /**
  * Convert a text value into a DBMS specific format that is suitable to
  * compose query statements.
  *
  * @param resource  $prepared_query query handle from prepare()
  * @param           $parameter
  * @param           $lob
  * @return string text string that represents the given argument value in
  *      a DBMS specific format.
  * @access private
  */
 function _quoteLOB($lob)
 {
     $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
     if (MDB2::isError($connect = $db->connect())) {
         return $connect;
     }
     $prepared_query = $GLOBALS['_MDB2_LOBs'][$lob]->prepared_query;
     $parameter = $GLOBALS['_MDB2_LOBs'][$lob]->parameter;
     $value = '';
     // DEAL WITH ME
     if (!($db->transaction_id = @ibase_trans(IBASE_COMMITTED, $db->connection))) {
         return $db->raiseError(MDB2_ERROR, null, null, 'Could not start a new transaction: ' . ibase_errmsg());
     }
     if ($lo = @ibase_blob_create($db->auto_commit ? $db->connection : $db->transaction_id)) {
         while (!$this->endOfLOB($lob)) {
             $result = $this->readLOB($lob, $data, $db->options['lob_buffer_length']);
             if (MDB2::isError($result)) {
                 break;
             }
             if (@ibase_blob_add($lo, $data) === false) {
                 $result = $db->raiseError(MDB2_ERROR, null, null, 'Could not add data to a large object: ' . ibase_errmsg());
                 break;
             }
         }
         if (MDB2::isError($result)) {
             @ibase_blob_cancel($lo);
         } else {
             $value = @ibase_blob_close($lo);
         }
     } else {
         $result = $db->raiseError();
     }
     if (!isset($db->query_parameters[$prepared_query])) {
         $db->query_parameters[$prepared_query] = array(0, '');
         $db->query_parameter_values[$prepared_query] = array();
     }
     $query_parameter = count($db->query_parameters[$prepared_query]);
     $db->query_parameters[$prepared_query][$query_parameter] = $value;
     $db->query_parameter_values[$prepared_query][$parameter] = $query_parameter;
     $value = '?';
     if (!$db->auto_commit) {
         $db->commit();
     }
     return $value;
 }
예제 #9
0
 /**
  * @see ILumine_Connection::begin()
  */
 public function begin($transactionID = null)
 {
     $id = $this->transactions_count++;
     $this->transactions[$id] = ibase_trans(IBASE_DEFAULT, $this->conn_id);
     return $id;
 }
예제 #10
0
 /**
  * Begin a transaction.
  *
  * @return void
  */
 protected function _beginTransaction()
 {
     $this->_connect();
     if (is_resource($this->_transResource)) {
         return;
     }
     $this->_transResource = ibase_trans(IBASE_DEFAULT, $this->_connection);
 }
예제 #11
0
 /**
  * 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 MDB2_OK on success, a MDB2 error on failure
  * @access public
  */
 function rollback()
 {
     $this->debug('rolling back transaction', 'rollback');
     if ($this->auto_commit) {
         return $this->raiseError(MDB2_ERROR, null, null, 'rollback: transactions can not be rolled back when changes are auto commited');
     }
     if ($this->transaction_id && !@ibase_rollback($this->connection)) {
         return $this->raiseError(MDB2_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(MDB2_ERROR, null, null, 'rollback: Could not start a new transaction: ' . ibase_errmsg());
     }
     return MDB2_OK;
 }
예제 #12
0
 function Transaction($intQuery)
 {
     if ($this->intDebug) {
         echo "Use transaction...\t\t<br>";
     }
     $this->intTrans = ibase_trans($this->intConn);
     $this->intTranStatus = 0;
     return $this->intTrans;
 }
예제 #13
0
 /**
  * Begin Transaction.
  *
  * @return bool
  */
 protected function _trans_begin()
 {
     if (($trans_handle = ibase_trans($this->conn_id)) === false) {
         return false;
     }
     $this->_ibase_trans = $trans_handle;
     return true;
 }
예제 #14
0
 /**
  * Begin Transaction
  *
  * @param	bool	$test_mode
  * @return	bool
  */
 public function trans_begin($test_mode = FALSE)
 {
     // When transactions are nested we only begin/commit/rollback the outermost ones
     if (!$this->trans_enabled or $this->_trans_depth > 0) {
         return TRUE;
     }
     // Reset the transaction failure flag.
     // If the $test_mode flag is set to TRUE transactions will be rolled back
     // even if the queries produce a successful result.
     $this->_trans_failure = $test_mode === TRUE;
     $this->_ibase_trans = ibase_trans($this->conn_id);
     return TRUE;
 }
예제 #15
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);
     }
 }
예제 #16
0
    protected function criaTransacao() {
	return ibase_trans();
    }
예제 #17
0
 public function startTrans()
 {
     //数据rollback 支持
     if ($this->transTimes == 0) {
         ibase_trans(IBASE_DEFAULT, $this->_linkID);
     }
     $this->transTimes++;
     return;
 }
 /**
  * Convert a text value into a DBMS specific format that is suitable to
  * compose query statements.
  *
  * @param resource  $prepared_query query handle from prepare()
  * @param           $parameter
  * @param           $lob
  * @return string text string that represents the given argument value in
  *      a DBMS specific format.
  * @access private
  */
 function _getLobValue($prepared_query, $parameter, $lob)
 {
     if (MDB::isError($connect = $this->connect())) {
         return $connect;
     }
     $value = '';
     // DEAL WITH ME
     if (!($this->transaction_id = @ibase_trans(IBASE_COMMITTED, $this->connection))) {
         return $this->raiseError(MDB_ERROR, NULL, NULL, '_getLobValue: Could not start a new transaction: ' . @ibase_errmsg());
     }
     if ($lo = @ibase_blob_create($this->auto_commit ? $this->connection : $this->transaction_id)) {
         while (!$this->endOfLob($lob)) {
             if (MDB::isError($result = $this->readLob($lob, $data, $this->options['lob_buffer_length']))) {
                 break;
             }
             if (@ibase_blob_add($lo, $data) === false) {
                 $result = $this->raiseError(MDB_ERROR, NULL, NULL, '_getLobValue - Could not add data to a large object: ' . @ibase_errmsg());
                 break;
             }
         }
         if (MDB::isError($result)) {
             @ibase_blob_cancel($lo);
         } else {
             $value = @ibase_blob_close($lo);
         }
     } else {
         $result = $this->raiseError(MDB_ERROR, NULL, NULL, 'Get LOB field value' . @ibase_errmsg());
     }
     if (!isset($this->query_parameters[$prepared_query])) {
         $this->query_parameters[$prepared_query] = array(0, '');
         $this->query_parameter_values[$prepared_query] = array();
     }
     $query_parameter = count($this->query_parameters[$prepared_query]);
     $this->query_parameter_values[$prepared_query][$parameter] = $query_parameter;
     $this->query_parameters[$prepared_query][$query_parameter] = $value;
     $value = '?';
     if (!$this->auto_commit) {
         $this->commit();
     }
     return $value;
 }
예제 #19
0
 public function startTrans()
 {
     $this->initConnect(true);
     if (!$this->_linkID) {
         return false;
     }
     //数据rollback 支持
     if ($this->transTimes == 0) {
         ibase_trans(IBASE_DEFAULT, $this->_linkID);
     }
     $this->transTimes++;
     return;
 }
예제 #20
0
 function transactionInit($trans_args = 0)
 {
     return $trans_args ? @ibase_trans($trans_args, $this->connection) : @ibase_trans();
 }
예제 #21
0
 public function begin_trans()
 {
     $this->trans = ibase_trans(IBASE_DEFAULT, $this->connection);
 }
예제 #22
0
 /**
  * Begin Transaction
  *
  * @return	bool
  */
 protected function _trans_begin()
 {
     if (($trans_handle = ibase_trans($this->conn_id)) === FALSE) {
         return FALSE;
     }
     $this->_ibase_trans = $trans_handle;
     return TRUE;
 }
예제 #23
0
 public function transStart()
 {
     $this->ibase_trans = ibase_trans($this->connect);
     return true;
 }
예제 #24
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;
 }
예제 #25
0
파일: ibase.php 프로젝트: Dulciane/jaws
 /**
  * Start a transaction or set a savepoint.
  *
  * @param   string  name of a savepoint to set
  * @return  mixed   MDB2_OK on success, a MDB2 error on failure
  *
  * @access  public
  */
 function beginTransaction($savepoint = null)
 {
     $this->debug('Starting transaction/savepoint', __FUNCTION__, array('is_manip' => true, 'savepoint' => $savepoint));
     if (null !== $savepoint) {
         if (!$this->in_transaction) {
             return $this->raiseError(MDB2_ERROR_INVALID, null, null, 'savepoint cannot be released when changes are auto committed', __FUNCTION__);
         }
         $query = 'SAVEPOINT ' . $savepoint;
         return $this->_doQuery($query, true);
     }
     if ($this->in_transaction) {
         return MDB2_OK;
         //nothing to do
     }
     $connection = $this->getConnection();
     if (MDB2::isError($connection)) {
         return $connection;
     }
     $result = @ibase_trans(IBASE_DEFAULT, $connection);
     if (!$result) {
         return $this->raiseError(null, null, null, 'could not start a transaction', __FUNCTION__);
     }
     $this->transaction_id = $result;
     $this->in_transaction = true;
     return MDB2_OK;
 }
            } else {
                $ID_PARKIR = $fbird->setGenerator('GEN_PENDATAAN_PPARKIR');
                $id_rekening = getIdRekening($_REQUEST['rekening']);
                $exception = array('pparkir_alamat', 'pparkir_id_desa');
                $other_request = array('pparkir_id' => $ID_PARKIR, 'pendataan_id' => $_REQUEST['FK'], 'dasar_pengenaan' => $_REQUEST['pengenaan'], 'persen_tarif' => $_REQUEST['persen'], 'id_rekening' => $id_rekening, 'nominal' => $_REQUEST['pajak']);
                ibase_trans();
                $b = $fbird->FBInsert('pendataan_pparkir', $other_request, $exception);
                unset($exception);
                unset($other_request);
            }
        } else {
            //data umum
            $ID = $fbird->setGenerator('GEN_PENDATAAN_SPT');
            $exception = array('spt_id', 'memo', 'nama_kegiatan');
            $other_request = array('pendataan_no' => $_REQUEST['nomor'], 'pendataan_id' => $ID);
            ibase_trans();
            $a = $fbird->FBInsert('pendataan_spt', $other_request, $exception);
            if ($a) {
                echo $ID;
            } else {
            }
            unset($exception);
            unset($other_request);
        }
    }
}
if ($_REQUEST['sender'] == "entri_pendaftaran_bu") {
    $cek = b_fetch('select count(*) from pendaftaran where no_pendaftaran=' . quote_smart($_REQUEST['no_pendaftaran']));
    if (!$cek) {
        $nomor = $_REQUEST['no_pendaftaran'];
        $nmax = (int) substr($_REQUEST['no_pendaftaran'], 1);
예제 #27
0
파일: Ibase.php 프로젝트: vakata/database
 public function begin()
 {
     $this->connect();
     $this->transaction = \ibase_trans($this->lnk);
     if ($this->transaction === false) {
         $this->transaction === null;
     }
     return $this->transaction !== null;
 }