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

fix(java/driver/jdbc): fix connection leak in JdbcDataSourceDatabase constructor #1418

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

rtadepalli
Copy link
Contributor

@rtadepalli rtadepalli commented Jan 1, 2024

I think there is a connection leak in the constructor for JdbcDataSourceDatabase where we're obtaining a connection in the constructor but we're obtaining another one in the connect method using the appropriate username/password. We can remove this and fix the bug as described in #1415.

Fixes #1415.

Copy link

github-actions bot commented Jan 1, 2024

⚠️ Please follow the Conventional Commits format in CONTRIBUTING.md for PR titles.

@github-actions github-actions bot added this to the ADBC Libraries 0.9.0 milestone Jan 1, 2024
@rtadepalli rtadepalli changed the title Fix connection leak in JdbcDataSourceDatabase constructor and pass in username/pass while getting connection fix(java): fix connection leak in JdbcDataSourceDatabase constructor and pass in username/pass while getting connection Jan 1, 2024
@rtadepalli rtadepalli changed the title fix(java): fix connection leak in JdbcDataSourceDatabase constructor and pass in username/pass while getting connection fix(java): fix connection leak in JdbcDataSourceDatabase constructor Jan 1, 2024
@lidavidm lidavidm changed the title fix(java): fix connection leak in JdbcDataSourceDatabase constructor fix(java/driver/jdbc): fix connection leak in JdbcDataSourceDatabase constructor Jan 2, 2024
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my intent was to test the credentials up front but this probably makes more sense.

@lidavidm
Copy link
Member

lidavidm commented Jan 2, 2024

Can we add a unit test? It could also be an integration test with Postgres.

@lidavidm lidavidm merged commit 61c9236 into apache:main Jan 3, 2024
13 checks passed
@lidavidm
Copy link
Member

lidavidm commented Jan 3, 2024

I've merged this for now, we can follow up.

@rtadepalli rtadepalli deleted the check-username-before-conn branch January 6, 2024 01:16
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

Successfully merging this pull request may close these issues.

java: JdbcDataSourceDatabase doesn't always use given username/password
2 participants