Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
1579 Представления

When I use multi-threaded concurrent submissions account.move action_post ,I got an error :Due to inability to access serial synchronization updates,After my investigation, I found that it is not possible to generate the last_sequence。

how i can do


Аватар
Отменить
Автор Лучший ответ
# Unable  to  generate serial numbers concurrently 

class SequenceMixin()
    def _get_last_sequence(self, relaxed=False, with_prefix=None):	​...​
query = """
​UPDATE {table} SET write_date = write_date WHERE id = (
​SELECT id FROM {table}
​{where_string}
​AND sequence_prefix = (SELECT sequence_prefix FROM {table} {where_string} ORDER BY id DESC LIMIT 1)
​ORDER BY sequence_number DESC
​LIMIT 1
​)
​​RETURNING {field};
​""".format(
​table=self._table,
​where_string=where_string,
​field=self._sequence_field,
​)

...





Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
сент. 24
1465
2
мар. 24
3174
2
февр. 23
3747
6
окт. 20
37973
1
сент. 20
4413