DDC-691: doctrine.readOnly query hint #852

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

Originally created by @doctrinebot on GitHub (Jul 15, 2010).

Jira issue originally created by user romanb:

Setting such a query hint to TRUE should result in all entities being retrieved by that query to be read-only for the purposes of change-tracking. Note that the entities themselves need not necessarily be read-only in general.

This feature is a flush performance tweak that can be used to query for objects but not let the returned objects run through change-tracking on flush. Any other managed objects are tracked as usual so you can do a read-only query for 100 entities and persist a new entity in the same unit of work with optimal flushing performance.

Originally created by @doctrinebot on GitHub (Jul 15, 2010). Jira issue originally created by user romanb: Setting such a query hint to TRUE should result in all entities being retrieved by that query to be read-only for the purposes of change-tracking. Note that the entities themselves need not necessarily be read-only in general. This feature is a flush performance tweak that can be used to query for objects but not let the returned objects run through change-tracking on flush. Any other managed objects are tracked as usual so you can do a read-only query for 100 entities and persist a new entity in the same unit of work with optimal flushing performance.
admin closed this issue 2026-01-22 12:52:42 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 26, 2011):

Comment created by koc:

Any news?
Why query hint? What about temporary switching like fetch mode changing via query object?

@doctrinebot commented on GitHub (Dec 26, 2011): Comment created by koc: Any news? Why query hint? What about temporary switching like fetch mode changing via query object?
Author
Owner

@doctrinebot commented on GitHub (May 31, 2012):

Comment created by acid24:

Any news on this?

I think this is a must have feature. Thanks for all your work.

@doctrinebot commented on GitHub (May 31, 2012): Comment created by acid24: Any news on this? I think this is a must have feature. Thanks for all your work.
Author
Owner

@beberlei commented on GitHub (Apr 18, 2021):

Merged into 2.9.x

@beberlei commented on GitHub (Apr 18, 2021): Merged into 2.9.x
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#852