Commit 828e4d5b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! ERP5Site: add erp5_sql_read_committed_connection.

parent 5fd4afd9
......@@ -2282,8 +2282,10 @@ class ERP5Generator(PortalGenerator):
# The only difference compared to activity connection is the
# minus prepended to the connection string.
if id == 'erp5_sql_transactionless_connection':
# omit isolation-level and add '-' sign in front of the database.
connection_string = re.sub(r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)', r'\1-\3', p.cmf_activity_sql_connection_string)
elif id == 'erp5_sql_read_committed_connection':
# force READ-COMMITTED isolation-level.
connection_string = re.sub(r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)', r'\1!READ-COMMITTED \3', p.erp5_sql_connection_string)
else:
connection_string = getattr(p, id + '_string')
......
......@@ -107,12 +107,14 @@ def _getConnectionStringDict():
if connection_string:
connection_string_dict[connection] = connection_string
connection = 'cmf_activity_sql_connection_string'
# force READ-COMMITTED isolation-level.
connection_string_dict[connection] = \
os.environ.get(connection, re.sub(
r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)', r'\1!READ-COMMITTED \3', connection_string_dict['erp5_sql_connection_string']))
# default value for transactionless is derived from value
# for cmf_activity, so process it last
connection = 'erp5_sql_transactionless_connection_string'
# omit isolation-level and add '-' sign in front of the database.
connection_string_dict[connection] = \
os.environ.get(connection, re.sub(
r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)', r'\1-\3', connection_string_dict['cmf_activity_sql_connection_string']))
......
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