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
This commit is contained in:
Cédric Krier committed 2024-05-23 14:22:42 +02:00
1 parent f0f2294d2c
commit 25d0cb7787
1 file changed
+1 -3
+1 -3
View File
@@ -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()