Commit d95690fc authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

SQLCatalog: add read_committed argument in getConnectionId().

parent edccff06
...@@ -2433,15 +2433,19 @@ class Catalog(Folder, ...@@ -2433,15 +2433,19 @@ class Catalog(Folder,
return method(catalog=catalog) return method(catalog=catalog)
security.declarePublic('getConnectionId') security.declarePublic('getConnectionId')
def getConnectionId(self, deferred=False): def getConnectionId(self, deferred=False, read_committed=False):
""" """
Returns the 'normal' connection being used by the SQL Method(s) in this Returns the 'normal' connection being used by the SQL Method(s) in this
catalog. catalog.
If 'deferred' is True, then returns the deferred connection If 'deferred' is True, then returns the deferred connection
""" """
assert not (deferred and read_committed), 'No connection should have deferred AND read_committed.'
for method in self.objectValues(): for method in self.objectValues():
if method.meta_type in ('Z SQL Method', 'ERP5 SQL Method') and ('deferred' in method.connection_id) == deferred: if method.meta_type in ('Z SQL Method', 'ERP5 SQL Method'):
return method.connection_id connection_id = method.connection_id
if ('deferred' in connection_id) == deferred and \
('read_committed' in connection_id) == read_committed:
return connection_id
def getSqlCatalogObjectList(self): def getSqlCatalogObjectList(self):
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment