Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-309

ReflectionException when using AbstractQuery::iterate()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-BETA1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      When I use two Queries and iterate() over the results, the second one fails with a PHP Fatal error (ReflectionException). It has a strange message ('Class does not exist').
      This happens with any two different entities. The error seems to occur when next() is called (directly or via foreach) and the objects are being created.

      $q = $em->createQuery('SELECT c FROM Entity\Country c');
      $q->iterate()->next();
      
      $q = $em->createQuery('SELECT u FROM Entity\User u');
      $q->iterate()->next(); // FAILS
      

      Entities:
      http://pastie.org/816374

      Example code:
      http://pastie.org/816377

      1. ddc309.patch
        4 kB
        Benjamin Eberlei

        Activity

        Nico Kaiser created issue -
        Roman S. Borschel made changes -
        Field Original Value New Value
        Assignee Roman S. Borschel [ romanb ] Benjamin Eberlei [ beberlei ]
        Hide
        Benjamin Eberlei added a comment -

        It seems IterableResult does not support two iterators at once, because it re-uses the hydrator for both queries - effectivly deleting the information from the previous query and destroying the call.

        Show
        Benjamin Eberlei added a comment - It seems IterableResult does not support two iterators at once, because it re-uses the hydrator for both queries - effectivly deleting the information from the previous query and destroying the call.
        Hide
        Benjamin Eberlei added a comment -

        Suggested patch

        Show
        Benjamin Eberlei added a comment - Suggested patch
        Benjamin Eberlei made changes -
        Attachment ddc309.patch [ 10358 ]
        Hide
        Benjamin Eberlei added a comment -

        Fixed!

        Show
        Benjamin Eberlei added a comment - Fixed!
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0-BETA1 [ 10030 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 10854 ] jira-feedback [ 14259 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14259 ] jira-feedback2 [ 16123 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16123 ] jira-feedback3 [ 18376 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-309, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Nico Kaiser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: