mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
defaultQueryHints is not applied doctrine generated queries #6146
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tinntsea on GitHub (Dec 26, 2018).
Originally assigned to: @tinntsea on GitHub.
Bug Report
I'm using symfony 3, postgres, and doctrine 2.6.2.
I wanted the application to read from master db in some cases to prevent replication lag issue.
So I used setDefaultQueryHints function in order to append /NO LOAD BALANCE/ comment as prefix of every select query.
The thing is it is not applied to doctrine generated queries
@Ocramius commented on GitHub (Dec 27, 2018):
Could you please make an example or failing test case?
@beberlei commented on GitHub (Dec 6, 2020):
Doctrine does not use DQL internally, as such the query hints are not applied.