本文整理汇总了PHP中ibase_trans函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_trans函数的具体用法?PHP ibase_trans怎么用?PHP ibase_trans使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_trans函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _performTransaction
function _performTransaction($parameters = null)
{
if ($parameters === null) {
$parameters = $this->bestTrans;
}
$this->trans = ibase_trans($parameters, $this->link);
}
示例2: gcms_trans
function gcms_trans()
{
global $fbdb, $gcms_trans_id;
if (!$gcms_trans_id) {
$gcms_trans_id = ibase_trans(IBASE_COMMITTED, $fbdb);
}
}
示例3: _performTransaction
function _performTransaction($parameters = null)
{
if ($parameters === null) {
$parameters = $this->DbSimple_Ibase_BEST_TRANSACTION;
}
$this->trans = @ibase_trans($parameters, $this->link);
}
示例4: BeginTrans
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: begin_transaction
/**
* 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: begin
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: begin
/**
* 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: _quoteLOB
/**
* 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: begin
/**
* @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: _beginTransaction
/**
* 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: rollback
/**
* 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: Transaction
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: _trans_begin
/**
* 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: trans_begin
/**
* 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: trans
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);
}
}