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

Add disposal of NpgsqlDataSource after opening connection #771

Merged
merged 5 commits into from
Sep 7, 2024

Conversation

marcominerva
Copy link
Contributor

@marcominerva marcominerva commented Sep 5, 2024

Motivation and Context (Why the change? What's the scenario?)

See #679.

High level description (Approach, Design)

If I call ImportDocumentAsync and then AskAsync, after the execution I see that two sessions are still in the list:

image

This PR adds the disposal the NpgsqlDataSource after each connection. In this way, no pending sessions remain when the execution completes.

NOTE: for the moment, I have left the IDisposable interface on PostgresDbClient.cs (with an empty implementation for reference), but actually it is no longer necessary, as explained in #679 (comment). So, I think it could be safely removed.

@dluc dluc added the waiting for author Waiting for author to reply or address comments label Sep 5, 2024
@dluc dluc merged commit 9bad713 into microsoft:main Sep 7, 2024
6 checks passed
@marcominerva marcominerva deleted the postgres-connectionfix branch September 10, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Waiting for author to reply or address comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants