Changes between Version 1 and Version 2 of Ticket #37369, comment 3
- Timestamp:
- Sep 26, 2026, 12:46:16 PM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37369, comment 3
v1 v2 1 1 Have we considered adding a new `transaction` API replacement that implements the current behaviour instead of taking it away entirely? 2 2 3 I understand the rationale for defaulting to having `on_commit` raise when called outside of a transaction (mainly due its name) but I believe there is nonetheless merit in having a public API that allows the conditional deferr ingof an operation in code paths that may or may not be called within a transaction. It feels like a common enough pattern not to warrant making an explicit `in_transaction` check this is needed?3 I understand the rationale for defaulting to having `on_commit` raise when called outside of a transaction (mainly due its name) but I believe there is nonetheless merit in having a public API that allows the conditional deferral of an operation in code paths that may or may not be called within a transaction. It feels like a common enough pattern not to warrant making an explicit `in_transaction` check this is needed? 4 4 5 5 If we introduced a `defer_if_in_transaction` (better name very welcome) public API as a replacement we wouldn't require a setting as the deprecation warning could simply point at using it instead of `on_commit` (when the latter is called outside of a transaction) before we finally change the default behaviour of `on_commit`.