Disable subtransactions in table locking transaction
disable subtransactions to prevent interrupting DB requests from interefering with table lock. Main issue is synchronizer interrupting and using the same session, leading MySQL to complain about subtransaction not locking tables Change-Id: Ia1031961c83e83d4b996d9eedc7261edd6a91e17
This commit is contained in:
parent
89cf265900
commit
ea9e8b877c
|
@ -67,7 +67,12 @@ def add_policy(id_, name, abbreviation, description, owner, kind,
|
|||
(cfg.CONF.database.connection.split(':/')[0] == 'postgresql' or
|
||||
cfg.CONF.database.connection.split('+')[0] == 'postgresql'))
|
||||
try:
|
||||
with session.begin(subtransactions=True):
|
||||
with session.begin(subtransactions=False):
|
||||
# Note(ekcs): disable subtransactions to prevent interrupting
|
||||
# DB requests from interefering with table lock. Main issue is
|
||||
# synchronizer interrupting and using the same session, leading
|
||||
# MySQL to complain about subtransaction not locking tables
|
||||
|
||||
# lock policies table to prevent duplicate named policy being added
|
||||
# after duplicate check but before transaction closes.
|
||||
# supported DBs are SQLite and MySQL and Postgres
|
||||
|
|
Loading…
Reference in New Issue