Skip to content

Introduced finalizeAndExecute to the AbstractSqlWalker, unified SingleStatementExecutor #11558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dciprian-petrisor
Copy link

@dciprian-petrisor dciprian-petrisor commented Jul 27, 2024

Fixes #11112

I've taken the approach suggested by @beberlei in #11188 (comment)

This essentially delays setting limit/offset and locking on the SQL to the finalizeAndExecute function, which accepts the Query object as a parameter.

I also unified the SingleSelectExecutor and SingleTableDeleteUpdateExecutor into a single class: SingleStatementExecutor since it was mostly the same implementation.

The Query::getQueryCacheId was changed to no longer care about the firstResult/maxResults parameters, since using them in the cache key results in different cache keys for what is essentially the same query.

I had to expose the selectedClasses field from the SqlWalker since it is used to determine if optimistic locking is possible.

Please let me know if this is an acceptable solution.

If so, I will gladly introduce tests/make any other necessary adjustments, per maintaniers' instructions.

Thank you!

@dciprian-petrisor
Copy link
Author

dciprian-petrisor commented Jul 27, 2024

One thing I realize now: the change to getQueryCacheId is backwards incompatible.
The limit/offset parameters have to be removed for this change to fix the original issue, otherwise there will be a cache miss no matter when we inject them into the sql.

I'm not sure how to proceed here, please guide me if this change needs to target a different branch or we can expose this behind some kind of configuration option/flag.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Query Cache in Doctrine ORM Causing Cache Memory Overflow
1 participant