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

Connection leak when using jOOQ and spring.jooq.sql-dialect has not been set #38924

Closed
wants to merge 1 commit into from

Conversation

skcskitano
Copy link
Contributor

SqlDialectLookup in jOOQ auto configuration doesn't close connection properly after obtaining it.

java.lang.Exception: Apparent connection leak detected
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:128)
    at org.springframework.boot.autoconfigure.jooq.SqlDialectLookup.getDialect(SqlDialectLookup.java:50)
    at org.springframework.boot.autoconfigure.jooq.JooqProperties.determineSqlDialect(JooqProperties.java:58)
    at org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration$DslContextConfiguration.jooqConfiguration(JooqAutoConfiguration.java:94)
...

This pull request wrap connection declaration in try-with-resource to fix connection leak.

@pivotal-cla
Copy link

@skcskitano Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 25, 2023
@pivotal-cla
Copy link

@skcskitano Thank you for signing the Contributor License Agreement!

@wilkinsona wilkinsona changed the title Fix connection leak in jOOQ auto configuration Connection leak when using jOOQ and spring.jooq.sql-dialect has not been set Jan 2, 2024
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 2, 2024
@wilkinsona wilkinsona added this to the 3.1.x milestone Jan 2, 2024
@mhalbritter mhalbritter self-assigned this Jan 10, 2024
@mhalbritter mhalbritter modified the milestones: 3.1.x, 3.2.x Jan 10, 2024
@mhalbritter
Copy link
Contributor

Put into the 3.2.x bucket, as 3.1.x doesn't contain the bug.

@mhalbritter
Copy link
Contributor

Thank you very much and congratulations on your first contribution 🎉!

@mhalbritter mhalbritter modified the milestones: 3.2.x, 3.2.2 Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants