Skip to content

Revert "Recycle NpgsqlTransaction" (#2416) - #2617

Merged
roji merged 1 commit into
release/4.1from
RevertTransactionRecycle
Sep 11, 2019
Merged

roji merged 1 commit into
release/4.1from
RevertTransactionRecycle

Conversation

@roji

@roji roji commented Sep 11, 2019 •

Copy link
Copy Markdown
Member

This reverts commit 7b8e117 (issue #2416) for 4.1, which made us recycle transaction instances on a connector.

  • As part of transaction recycling, NpgsqlTransaction.IsCompleted was made internal, since the transaction instance will be revived, IsCompleted will switch from true to false, leading to potential confusion/dangerous behavior. This was a problem for at least one user ([4.1.0] experience report updating Marten #2607).
  • Even with transaction recycling, it's still possible to expose an IsCompleted property that would only be valid until the instance is disposed. However, currently there's no requirement to dispose NpgsqlTransaction - the moment a transaction is committed or rolled back, a new one can be started again. Changing that would be an even bigger breaking change.

Note that the commit remains in dev for 5.0, where we should decide on the exact behavior we want, opened #2618 to track.

@roji
roji merged this pull request into release/4.1 Sep 11, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the RevertTransactionRecycle branch September 11, 2019 15:12
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.

2 participants