Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1587 Visualizzazioni

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


Avatar
Abbandona
Autore Risposta migliore
# 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,
​)

...





Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
set 24
1468
2
mar 24
3175
2
feb 23
3753
6
ott 20
37978
1
set 20
4419