Do not get a new connection when retrying to lock table on transaction start

Closes #13661
(grafted from a36a983afe44fc569c04db4d3db71146400b6422)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2024-11-06 13:57:10 +01:00
1 parent 02e8407f30
commit 15b80c50c0
1 file changed
+2 -2
+2 -2
View File
@@ -192,12 +192,12 @@ class Transaction(object):
self.counter = 0
self._datamanagers = []
self.connection = database.get_connection(readonly=readonly,
autocommit=autocommit)
count = 0
while True:
if count:
time.sleep(0.002 * (_retry - count))
self.connection = database.get_connection(readonly=readonly,
autocommit=autocommit)
try:
lock_tables = extras.get('_lock_tables', [])
for table in lock_tables: