lib/ezdb/classes/ezdbinterface.php
function commit()
    {
        $ini = eZINI::instance();
        if ($ini->variable( "DatabaseSettings", "Transactions" ) == "enabled")
        {
            if ( $this->TransactionCounter <= 0 )
            {
                eZDebug::writeError( 'No transaction in progress, cannot commit', __METHOD__ );
                return false;
            }

            --$this->TransactionCounter;
            if ( $this->TransactionCounter == 0 )
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Reset the stack debug tree since the top commit was done
                    $this->TransactionStackTree = array();
                }
                if ( $this->isConnected() )
                {
                    // Check if we have encountered any problems, if so we have to rollback
                    if ( !$this->TransactionIsValid )
                    {
                        $oldRecordError = $this->RecordError;
                        // Turn off error handling while we rollback
                        $this->RecordError = false;
                        $this->rollbackQuery();
                        $this->RecordError = $oldRecordError;

                        return false;
                    }
                    else
                    {
                        $oldRecordError = $this->RecordError;
                        // Turn off error handling while we commit
                        $this->RecordError = false;
                        $this->commitQuery();
                        $this->RecordError = $oldRecordError;
                    }
                }
            }
            else
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Close the last open nested transaction
                    $bt = debug_backtrace();
                    // Store commit trace
                    $subLevels =& $this->TransactionStackTree['sub_levels'];
                    for ( $i = 1; $i < $this->TransactionCounter; ++$i )
                    {
                        $subLevels =& $subLevels[count( $subLevels ) - 1]['sub_levels'];
                    }
                    // Find last entry and add the commit trace
                    $subLevels[count( $subLevels ) - 1]['commit_trace'] = $bt;
                }
            }
        }
        return true;
    }
function commit()
    {
        $ini = eZINI::instance();
        if ($ini->variable( "DatabaseSettings", "Transactions" ) == "enabled")
        {
            if ( $this->TransactionCounter <= 0 )
            {
                eZDebug::writeError( 'No transaction in progress, cannot commit', __METHOD__ );
                return false;
            }

            --$this->TransactionCounter;
            if ( $this->TransactionCounter == 0 )
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Reset the stack debug tree since the top commit was done
                    $this->TransactionStackTree = array();
                }
                if ( $this->isConnected() )
                {
                    // Check if we have encountered any problems, if so we have to rollback
                    if ( !$this->TransactionIsValid )
                    {
                        $oldRecordError = $this->RecordError;
                        // Turn off error handling while we rollback
                        $this->RecordError = false;
                        $this->rollbackQuery();
                        $this->RecordError = $oldRecordError;

                        return false;
                    }
                    else
                    {
                        $oldRecordError = $this->RecordError;
                        // Turn off error handling while we commit
                        $this->RecordError = false;
                        $this->commitQuery();
                        $this->RecordError = $oldRecordError;
                    }
                }
            }
            else
            {
                if ( is_array( $this->TransactionStackTree ) )
                {
                    // Close the last open nested transaction
                    $bt = debug_backtrace();
                    // Store commit trace
                    $subLevels =& $this->TransactionStackTree['sub_levels'];
                    for ( $i = 1; $i < $this->TransactionCounter; ++$i )
                    {
                        $subLevels =& $subLevels[count( $subLevels ) - 1]['sub_levels'];
                    }
                    // Find last entry and add the commit trace
                    $subLevels[count( $subLevels ) - 1]['commit_trace'] = $bt;
                }
            }
        }
        return true;
    }
function commit ( ) { $ ini = eZINI :: instance ( ) ; if ( $ ini -> variable ( "DatabaseSettings" , "Transactions" ) == "enabled" ) { if ( $ this -> TransactionCounter <= 0 ) { eZDebug :: writeError ( 'No transaction in progress, cannot commit' , __METHOD__ ) ; return false ; } -- $ this -> TransactionCounter ; if ( $ this -> TransactionCounter == 0 ) { if ( is_array ( $ this -> TransactionStackTree ) ) { // Reset the stack debug tree since the top commit was done $ this -> TransactionStackTree = array ( ) ; } if ( $ this -> isConnected ( ) ) { // Check if we have encountered any problems, if so we have to rollback if ( ! $ this -> TransactionIsValid ) { $ oldRecordError = $ this -> RecordError ; // Turn off error handling while we rollback $ this -> RecordError = false ; $ this -> rollbackQuery ( ) ; $ this -> RecordError = $ oldRecordError ; return false ; } else { $ oldRecordError = $ this -> RecordError ; // Turn off error handling while we commit $ this -> RecordError = false ; $ this -> commitQuery ( ) ; $ this -> RecordError = $ oldRecordError ; } } } else { if ( is_array ( $ this -> TransactionStackTree ) ) { // Close the last open nested transaction $ bt = debug_backtrace ( ) ; // Store commit trace $ subLevels = & $ this -> TransactionStackTree [ 'sub_levels' ] ; for ( $ i = 1 ; $ i < $ this -> TransactionCounter ; ++ $ i ) { $ subLevels = & $ subLevels [ count ( $ subLevels ) - 1 ] [ 'sub_levels' ] ; } // Find last entry and add the commit trace $ subLevels [ count ( $ subLevels ) - 1 ] [ 'commit_trace' ] = $ bt ; } } } return true ; }
Commits the current transaction. If this is not the outermost it will not commit
to the database immediately but instead decrease the transaction counter.

If the current transaction had any errors in it the transaction will be rollbacked
instead of commited. This ensures that the database is in a valid state.
Also the PHP execution will be stopped.

@return bool true if the transaction was successful, false otherwise.
Commits the current transaction . If this is not the outermost it will not commit to the database immediately but instead decrease the transaction counter .