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

Query Timeout #791

Open
1 of 3 tasks
basejump opened this issue Apr 29, 2024 · 0 comments
Open
1 of 3 tasks

Query Timeout #791

basejump opened this issue Apr 29, 2024 · 0 comments

Comments

@basejump
Copy link
Member

basejump commented Apr 29, 2024

App Query Timeout

A default will be set on the database as outlined here https://www.crunchydata.com/blog/control-runaway-postgres-queries-with-statement-timeout (see here if you have 9ci access https://github.com/9ci/domain9/issues/1791)

Helpful links

timeout on transactoin, setting this level will pick up both hibernate and jdbcTemplate

query timeouts for hibernate, would change in gorm-tools

query timeout in jdbcTemplate

can be tested on postgres with select 1 from pg_sleep(15)

Phase 1 - Query timeout

  • check to see if spring.transaction.default-timeout works and it set in PlatformTrxManager. See links above.
  • If that doesn't work then lets setup a PreQueryEvent Listener. That is fired in all cases. MangoQuery fires it and Gorm fires it for all finders.
  • in the listener can get use the getHibernateCriteria() on the query property and set the timeout there. Lets just stick with setting it from whatever spring.transaction.default-timeout is set to.

Timeout by user or role

this will be able to be done in the PreQueryEventListner

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