Ejemplo n.º 1
0
/**
 * Tells the DB Layer to end a DB transaction.
 *
 * @access public
 * @param  boolean  If true, perform the query. If false, rollback.
 */
function serendipity_db_end_transaction($commit)
{
    global $serendipity;
    if ($commit) {
        sqlrcon_commit($serendipity['dbConn']);
    } else {
        sqlrcon_rollback($serendipity['dbConn']);
    }
}
 /**
  * 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;
     }
     $ret = sqlrcon_rollback($this->conn_id);
     $this->_commit = OCI_COMMIT_ON_SUCCESS;
     return $ret;
 }
Ejemplo n.º 3
0
 public function rollbackTransaction()
 {
     if ($this->_transaction) {
         $this->_transaction = false;
         $ret = sqlrcon_rollback($this->_conn);
         if ($ret === 0) {
             throw new DatabaseException('Commit failed');
         } else {
             if ($ret === -1) {
                 throw new DatabaseException('An error occurred. Commit failed');
             }
         }
         sqlrcon_autoCommitOn($this->_conn);
     }
 }