Uh oh!
There was an error while loading. Please reload this page.
[16.0] Add 'Allow Commit' option on job functions - #910
Conversation
It is forbidden to commit inside a job, because it releases the job lock and can cause it to start again, while still being run, by the dead jobs requeuer. For some use cases, it may actually be legitimate, or at least be needed in the short term before actual updates in the code. A new option on the job function, false by default, allow to run the job in a new transaction, at the cost of an additional connection + transaction overhead. Related to OCA#889
False on new databases, True on existing databases. Should always be False by default on future versions.
This reverts commit b4f3bec.
As the controller changes env on Job instances.
OCA-git-bot
commented
Mar 17, 2026
sbidoul
commented
Mar 26, 2026
@guewen I kind of remember you could set |
guewen
commented
Mar 26, 2026
@sbidoul It was only in your head 😂 I didn't think about that. Do you see a use case for this? For methods that accept a "commit=True" parameter? |
florian-dacosta
commented
Mar 26, 2026
On adapting |
sbidoul
commented
Mar 26, 2026
Yes that was what prompted my question ^. |
guewen
commented
Mar 26, 2026
I suppose most of the time, we know ahead of time when a job method will/should commit or not, so it makes more sense on the job function. If you had to set |
sbidoul
commented
Mar 27, 2026
@lmignon is this good to go? |
Uh oh!
There was an error while loading. Please reload this page.
guewen
commented
Apr 9, 2026
/ocabot merge major |
OCA-git-bot
commented
Apr 9, 2026
On my way to merge this fine PR! |
Uh oh!
There was an error while loading. Please reload this page.
OCA-git-bot
commented
Apr 9, 2026
Congratulations, your PR was merged at a760887. Thanks a lot for contributing to OCA. ❤️ |
Backport of #899