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

validation query(SELECT 1) alway execute #222

Open
zhuangzibin opened this issue Jan 21, 2025 · 2 comments
Open

validation query(SELECT 1) alway execute #222

zhuangzibin opened this issue Jan 21, 2025 · 2 comments

Comments

@zhuangzibin
Copy link

Bug Report

The issue is that validation query (SELECT 1) is triggerred at regular intervals when the application is started and these connection remains in idle status forever.

Versions

  • Driver:1.0.1
  • Database:pgsql
  • Java:17
  • OS:mac
@mp911de
Copy link
Member

mp911de commented Jan 21, 2025

Pool config defaults to local validation (i.e. whether the connection is connected to a server). Remote validation (ConnectionPoolConfiguration.Builder#validationDepth(REMOTE)) enables SELECT 1 validation queries.

Not quite sure what you're asking for. If you're seeing issues with connection starvation, you might want to update to Pool 1.0.2 and the latest Postgres driver.

@zhuangzibin
Copy link
Author

I think this check (select 1) is used to determine whether the thread is alive, rather than executing it (sql) every time before executing the statement.I think we should start a scheduled daemon thread to perform this check (select 1)

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

2 participants