[DDC-2340] Using Criteria matching on non-initialized collections ignore changes made on loaded entities Created: 07/Mar/13  Updated: 12/Mar/13  Resolved: 12/Mar/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.3.3
Security Level: All

Type: Bug Priority: Major
Reporter: Matthieu Napoli Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Given:

  • 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.



 Comments   
Comment by Benjamin Eberlei [ 12/Mar/13 ]

Fixed and merged for 2.3.3

Generated at Tue Sep 02 07:15:20 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.