Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-2340

Using Criteria matching on non-initialized collections ignore changes made on loaded entities


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.3
    • Component/s: None
    • Security Level: All
    • Labels:



      • you have a non initialized collection (association between entities)
      • you have loaded some entities that are in that collection and changed some fields (without flushing)

      If you do a matching using a Criteria on the collection (http://docs.doctrine-project.org/en/latest/reference/working-with-associations.html#filtering-collections), then the Criteria will be executed through a DB query. But the fields you changed are not updated in the DB, so if you filter/order on those fields, then the result of the filter() will be incorrect.

      However, if your collection was initialized, the Criteria matching will be done in memory on the ArrayCollection and the result will be correct.

      So we have the problem for Criteria filtering on non-initialized collections.


        mnapoli Matthieu Napoli created issue -
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.3 [ 10329 ]
        Resolution Fixed [ 1 ]
        beberlei Benjamin Eberlei added a comment -

        Fixed and merged for 2.3.3

        beberlei Benjamin Eberlei added a comment - Fixed and merged for 2.3.3

        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={expand=changesets[0:20].revisions[0:29],reviews, query=DDC-2340}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            beberlei Benjamin Eberlei
            mnapoli Matthieu Napoli
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created: