Skip to content
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

### Motivation / Background #2065

Closed
4 tasks done
xXxrAinSonic opened this issue Feb 6, 2025 · 0 comments
Closed
4 tasks done

### Motivation / Background #2065

xXxrAinSonic opened this issue Feb 6, 2025 · 0 comments

Comments

@xXxrAinSonic
Copy link

Motivation / Background

The StatementCache uses a different code path for generating SQL and executing queries, so it doesn't currently benefit from the ability to mark queries as retryable. This mainly affects association SELECTs, because the other user of StatementCache is find_by and it explicitly passes allow_retry: true when executing a cached query.

Detail

This commit enables queries that would be retryable without using the StatementCache to also be retryable when using it. Just like in to_sql_and_binds, cacheable_query now sets retryable: true on the collector that constructs the query and additionally copies the collector's final retryable value to the query object. Then, instead of accepting an allow_retry parameter when executing the cached query, execute now uses the query object's retryable attribute.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Originally posted by @skipkayhil in rails/rails#54436

Originally posted by @xXxrAinSonic in https://github.com/iobroker-community-adapters/ioBroker.smartcontrol/issues/229

Originally posted by @xXxrAinSonic in opa334/Dopamine#680

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

No branches or pull requests

1 participant