[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:
depends on DDC-22 EntityManager#refresh() should also r... Closed


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.

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 Fri Oct 09 23:58:34 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.