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

Periodically validate JDBC connections #4443

Merged
merged 2 commits into from
Oct 8, 2019
Merged

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Oct 8, 2019

Fixes #2336

Agroal uses ConnectionValidator.emptyValidator() by default,
so even if we set the default validation interval to 2 minutes by
default, it will just do nothing every 2 minutes.

Tested manually by putting a thread-suspending breakpoint on the line storeTestPersons(entityManagerFactory); in JPAFunctionalityTestEndpoint.
Just run io.quarkus.it.jpa.mariadb.JPAFunctionalityTest, and when the breakpoint is hit, restart the database, wait 2 minutes, and resume execution. Before this patch, the call to storeTestPersons(entityManagerFactory); would fail because a stale connection was in the ppol; after this patch, it will succeed because the connection was removed and renewed.

Agroal uses ConnectionValidator.emptyValidator() by default,
so even if we set the default validation interval to 2 minutes by
default, it will just do nothing every 2 minutes.

Fixes quarkusio#2336
@yrodiere yrodiere requested a review from gsmet October 8, 2019 16:07
@gsmet gsmet added this to the 0.24.0 milestone Oct 8, 2019
@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 8, 2019
@Sanne
Copy link
Member

Sanne commented Oct 8, 2019

thanks @yrodiere !

@gsmet
Copy link
Member

gsmet commented Oct 8, 2019

Windows failure is unrelated, I'll merge this.

Thanks @yrodiere !

@gsmet gsmet merged commit 86e266f into quarkusio:master Oct 8, 2019
@yrodiere yrodiere deleted the i2336 branch May 17, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/waiting-for-ci Ready to merge when CI successfully finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken pipe (Write failed) using Hibernate ORM and MariaDB
3 participants