Skip to content

Recycle NpgsqlTransaction - #2427

Merged
roji merged 1 commit into
npgsql:devfrom
roji:RecycleTransaction
May 15, 2019
Merged

roji merged 1 commit into
npgsql:devfrom
roji:RecycleTransaction

Conversation

@roji

@roji roji commented Apr 10, 2019

Copy link
Copy Markdown
Member

Since PostgreSQL only supports on transaction on a given connection, we reycle the NpgsqlTransaction object.

Closes #2416

@YohDeadfall @austindrenski the lifecycle changes here aren't exactly trivial, so I'd appreciate a good review. In the end I think the logic is actually simplified, since the NpgsqlTransaction's state simply mirrors the connector's TransactionStatus (except for disposal, which is still managed on the NpgsqlTransaction since it's user-controlled).

@YohDeadfall YohDeadfall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice to see some code cleanup as an addition to the changes.

@austindrenski

Copy link
Copy Markdown
Contributor

@roji Could you rebase this when you have a chance?

@austindrenski austindrenski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the end I think the logic is actually simplified

Definitely agree, nice work on this @roji!

Since PostgreSQL only supports on transaction on a given connection,
we reycle the NpgsqlTransaction object.

Closes npgsql#2416
@roji
roji force-pushed the RecycleTransaction branch from cf15d95 to 6220f64 Compare May 15, 2019 01:26
@roji
roji merged commit 7b8e117 into npgsql:dev May 15, 2019
@roji
roji deleted the RecycleTransaction branch May 15, 2019 01:39
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.

Recycle NpgsqlTransaction

3 participants