Mercurial > p > roundup > code
diff roundup/backends/back_anydbm.py @ 8305:a81a3cd067fa
Generate savepoint only if necessary
Now some methods got an additional 'allow_abort' parameter. By default
this is True. When False the postgres backend generates a savepoint.
The methods are called with allow_abort=False from some of the cgi
methods which can produce a traceback when called with data from the
web-interface.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Sat, 01 Mar 2025 18:55:54 +0100 |
| parents | 24549122f9b1 |
| children | be227ab4c2e1 |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Sat Mar 01 13:08:09 2025 +0100 +++ b/roundup/backends/back_anydbm.py Sat Mar 01 18:55:54 2025 +0100 @@ -381,11 +381,13 @@ 'save %s%s %r' % (classname, nodeid, node)) self.transactions.append((self.doSaveNode, (classname, nodeid, node))) - def getnode(self, classname, nodeid, db=None, cache=1): + def getnode(self, classname, nodeid, db=None, cache=1, allow_abort=True): """ get a node from the database Note the "cache" parameter is not used, and exists purely for backward compatibility! + + 'allow_abort' is used only in sql backends. """ # try the cache cache_dict = self.cache.setdefault(classname, {}) @@ -1026,7 +1028,7 @@ return newid - def get(self, nodeid, propname, default=_marker, cache=1): + def get(self, nodeid, propname, default=_marker, cache=1, allow_abort=True): """Get the value of a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an @@ -1035,6 +1037,8 @@ 'cache' exists for backward compatibility, and is not used. + 'allow_abort' is used only in sql backends. + Attempts to get the "creation" or "activity" properties should do the right thing. """ @@ -1459,8 +1463,9 @@ self.fireReactors('restore', nodeid, None) - def is_retired(self, nodeid, cldb=None): + def is_retired(self, nodeid, cldb=None, allow_abort=True): """Return true if the node is retired. + 'allow_abort' is used only in sql backends. """ node = self.db.getnode(self.classname, nodeid, cldb) if self.db.RETIRED_FLAG in node:
