Skip to content

Successful migration doesn't close connection #3464

Closed

Description

@marcusber

After a successful migration, the connection is not closed.

Change catch to finally:

_connection.Open();
try
{
npgsqlConnection.ReloadTypes();
}
catch
{
_connection.Close();
}

and
await _connection.OpenAsync(cancellationToken).ConfigureAwait(false);
try
{
await npgsqlConnection.ReloadTypesAsync(cancellationToken).ConfigureAwait(false);
}
catch
{
await _connection.CloseAsync().ConfigureAwait(false);
}

Activity

  1. added a commit that references this issue on Feb 15, 2025
    c3e4236
  2. added a commit that references this issue on Feb 15, 2025
    192e2d6
  3. self-assigned this
    on Feb 15, 2025
  4. added this to the 9.0.4 milestone on Feb 15, 2025
  5. added 3 commits that reference this issue on Feb 15, 2025
    786b635
    6a34455
    e46e43e
  6. added a commit that references this issue on Mar 1, 2025
    83b5f63
  7. added theissue type on Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions