protected function forkAndExecute( $nodeID, $offset, $limit )
    {
        eZDB::setInstance( null );

        // Prepare DB-based cluster handler for fork (it will re-connect DB automatically).
        eZClusterFileHandler::preFork();

        $pid = pcntl_fork();

        // reinitialize DB after fork
        $this->initializeDB();

        if ( $pid == -1 )
        {
            die( 'could not fork' );
        }
        else if ( $pid )
        {
            // Main process
            return $pid;
        }
        else
        {
            // We are the child process
            if ( $this->execute( $nodeID, $offset, $limit ) > 0 )
            {
                $this->Script->shutdown( 0 );
            }
            else
            {
                $this->Script->shutdown( 3 );
            }
        }
    }