DDC-21: Already fetched associations should not be overriden by subsequent queries. #29

Closed
opened 2026-01-22 12:24:48 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 25, 2009).

Jira issue originally created by user romanb:

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.

Originally created by @doctrinebot on GitHub (Sep 25, 2009). Jira issue originally created by user romanb: 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.
admin added the Improvement label 2026-01-22 12:24:48 +01:00
admin closed this issue 2026-01-22 12:24:48 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 25, 2009):

@doctrinebot commented on GitHub (Sep 25, 2009): - depends on [DDC-22: EntityManager#refresh() should also refresh associations.](http://www.doctrine-project.org/jira/browse/DDC-22)
Author
Owner

@doctrinebot commented on GitHub (Sep 25, 2009):

Comment created by romanb:

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

@doctrinebot commented on GitHub (Sep 25, 2009): Comment created by romanb: This behavior is already correct for single-valued associations but not for collections. Needs to be fixed in ObjectHydrator.
Author
Owner

@doctrinebot commented on GitHub (Oct 9, 2009):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Oct 9, 2009): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#29