Skip to content

v4.0.0 with Major Changes #2

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

Merged
merged 2 commits into from
Jul 14, 2022
Merged

v4.0.0 with Major Changes #2

merged 2 commits into from
Jul 14, 2022

Conversation

mpyw
Copy link
Owner

@mpyw mpyw commented Jul 13, 2022

What's the matter?

Up to version 3.x, the Postgres driver had a fatal problem. When a session-level lock was acquired in a transaction, it was not always possible to release the lock during the finally blocks; once Postgres encountered an error in a transaction, it would kill all continuing operations with an error.

Two approaches were adopted to solve this problem:

Monitoring for commit/rollback events (including rollbacks to savepoints)

Even if the lock release process fails, it can be recovered by performing commit/rollback operations. When the event is detected, we will retry the lock release process.

Issue savepoints on withLocking() calls

If a transaction has already been opened, a savepoint is created immediately after lock acquisition so that the lock can be released on the fly after recovering from an error that occurred within the callback function.

Changes

  • AdvisoryLockServiceProvider has been added; which is automatically discovered.
  • withLocking() takes ConnectionInterface as a first argument.

@mpyw mpyw force-pushed the wip branch 3 times, most recently from dd5b800 to a13b48a Compare July 14, 2022 06:17
@mpyw mpyw changed the title wip v4.0.0 with Major Changes Jul 14, 2022
@mpyw mpyw marked this pull request as ready for review July 14, 2022 06:40
@mpyw mpyw self-assigned this Jul 14, 2022
@mpyw mpyw merged commit 1ab5546 into master Jul 14, 2022
@mpyw mpyw deleted the wip branch July 14, 2022 06:41
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.

1 participant