From 25d0cb77872c1469e39caaabd906cdce1634cc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 May 2024 14:22:42 +0200 Subject: [PATCH] Do not commit readonly transaction even with channel Even if the backend allows NOTIFY query on readonly transaction, it is strange to commit readonly transaction because the backend may not enforce the readonly. Also commit performs other actions that may not be wanted like commit datamanager or clear cache. A procedure that requires to perform a NOTIFY should have a non-readonly transaction. Closes #12542 --- trytond/trytond/transaction.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/trytond/trytond/transaction.py b/trytond/trytond/transaction.py index b078a4dff4..243a1a6ac0 100644 --- a/trytond/trytond/transaction.py +++ b/trytond/trytond/transaction.py @@ -231,9 +231,7 @@ class Transaction(object): if transactions.count(self) == 1: try: try: - # Transaction must be commited to send notifications - if commit and (not self.readonly - or self.database.has_channel()): + if commit and not self.readonly: self.commit() else: self.rollback()