Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1590 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất
# 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,
​)

...





Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 9 24
1470
2
thg 3 24
3177
2
thg 2 23
3756
6
thg 10 20
37985
1
thg 9 20
4421