[DDC-21] Already fetched associations should not be overriden by subsequent queries. Created: 25/Sep/09  Updated: 09/Oct/09  Resolved: 09/Oct/09

Status: Closed
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.0-ALPHA3
Security Level: All

Type: Improvement Priority: Critical
Reporter: Roman S. Borschel Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Dependency
depends on DDC-22 EntityManager#refresh() should also r... Closed

 Description   

The discussion about this was brought up by DC-41. After checking the behavior of other ORMs (notably Hibernate), already fetched associations should not be overridden by subsequent queries, just like with other persistent state of already fetched entities. This saves performance and can assure a better integrity of the object model in-memory.

Entities and their associations that are already in-memory should only be refreshed if this is done explicitly either through EntityManager#refresh($entity) or through using the Query::HINT_REFRESH query hint on any query.



 Comments   
Comment by Roman S. Borschel [ 25/Sep/09 ]

This behavior is already correct for single-valued associations but not for collections. Needs to be fixed in ObjectHydrator.

Generated at Thu Apr 17 01:12:46 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.