Fix a second Dispose of NpgsqlTransaction rolling back a later transaction by sanjaysingh · Pull Request #6670 · npgsql/npgsql · GitHub
Skip to content

Fix a second Dispose of NpgsqlTransaction rolling back a later transaction - #6670

Open
sanjaysingh wants to merge 1 commit into
npgsql:mainfrom
sanjaysingh:fix/6665-disposed-transaction-reuse
Open

sanjaysingh wants to merge 1 commit into
npgsql:mainfrom
sanjaysingh:fix/6665-disposed-transaction-reuse

Conversation

@sanjaysingh

Copy link
Copy Markdown

Disposing an NpgsqlTransaction twice could roll back a later transaction. The connector kept the disposed object, and the next BeginTransaction cleared IsDisposed. A disposed transaction now stays disposed, and the next begin allocates a new one.

Fixes #6665

Test plan

  • Transaction tests against PostgreSQL, including a pool of one connection where a second dispose no longer affects the later transaction

…ction.

Reusing it cleared IsDisposed, so a second Dispose rolled back the later transaction.

This branch has not been deployed

No deployments
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.

Double Disposal of NpgsqlTransaction can cause wrong connection to be closed / Connection Pool Exhaustion

1 participant