Changes between Version 2 and Version 3 of Ticket #37369, comment 3
- Timestamp:
- Sep 26, 2026, 12:46:52 PM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37369, comment 3
v2 v3 3 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 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`.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 its default behaviour.