diff --git a/changelog.d/4219-advisory-lock-abort-release.fixed.md b/changelog.d/4219-advisory-lock-abort-release.fixed.md deleted file mode 100644 index 00d2118403..0000000000 --- a/changelog.d/4219-advisory-lock-abort-release.fixed.md +++ /dev/null @@ -1 +0,0 @@ -- `withAdvisoryLock(transaction=true)` now releases its session-scoped database lock (MySQL, SQL Server) when the callback ends the request with `abort` or `redirectTo()`. The release previously ran in the same step that commits or rolls back the transaction, which some engines skip when an `abort` leaves the transaction, so the lock could stay held on the pooled connection until that connection closed; it now runs in its own step that executes on every engine, while the normal path still commits before releasing so the next holder reads committed state (#4219) diff --git a/changelog.d/tx-advisory-locks.added.md b/changelog.d/tx-advisory-locks.added.md index 3d65eeae91..04d7364829 100644 --- a/changelog.d/tx-advisory-locks.added.md +++ b/changelog.d/tx-advisory-locks.added.md @@ -1 +1 @@ -- `withAdvisoryLock()` now accepts an opt-in `transaction = true` argument that pins the lock acquire, the callback, and the release to one connection inside a transaction, so the lock genuinely covers the callback's own queries. On PostgreSQL the lock is transaction-scoped and auto-releases when the transaction ends; on MySQL and SQL Server it is a session lock released before the transaction closes. Supported on PostgreSQL, MySQL, and SQL Server; other databases throw rather than silently running session-scoped. Recommended for short critical sections — a long-running callback holds its row locks and a pooled connection (and blocks PostgreSQL VACUUM) for the whole call. Defaults to `false` (the existing behaviour). ([#4198](https://github.com/wheels-dev/wheels/issues/4198)) +- `withAdvisoryLock()` now accepts an opt-in `transaction = true` argument that pins the lock acquire, the callback, and the release to one connection inside a transaction, so the lock genuinely covers the callback's own queries. On PostgreSQL the lock is transaction-scoped and auto-releases when the transaction ends; on MySQL and SQL Server it is a session lock released before the transaction closes. Supported on PostgreSQL, MySQL, and SQL Server; other databases throw rather than silently running session-scoped. The lock is released even when the callback ends the request with `abort` or `redirectTo()`. Recommended for short critical sections — a long-running callback holds its row locks and a pooled connection (and blocks PostgreSQL VACUUM) for the whole call. Defaults to `false` (the existing behaviour). ([#4198](https://github.com/wheels-dev/wheels/issues/4198))