6

I am using PostgreSQL database (V 10) and odoo ERP (V 12).

When ever I try to update a table using 2 different users at the same time, I am getting

ERROR: could not serialize access due to concurrent update

I am getting this error even if I use multiple celery workers for parallel execution. Is there any solution for parallel update in the same table in PostgreSQL using odoo.

Thanks!

Ajay Viknesh
  • 127
  • 1
  • 2
  • 9
  • 2
    What SQL are the two different users performing? See documentation for more details on this error (https://www.postgresql.org/docs/9.1/transaction-iso.html) – richyen Dec 16 '19 at 06:57
  • 1
    Also, what is your transaction isolation level? – Laurenz Albe Dec 16 '19 at 07:03
  • Both the users are in the same application using the same database and same table at same time. This is nothing but a parallel execution or a simple multi threading process. – Ajay Viknesh Dec 16 '19 at 07:26
  • Do you know the queries behind that? Normally only rows are locked and Odoo's default query are "very" fast, so there shouldn't be a problem. It gets interesting with custom code and bad queries or just bad hardware. – CZoellner Dec 16 '19 at 08:33
  • 1
    The underlying problem is shown at: https://stackoverflow.com/questions/7705273/what-are-the-conditions-for-encountering-a-serialization-failure and https://stackoverflow.com/questions/50797097/postgres-could-not-serialize-access-due-to-concurrent-update/51932824 Most likely the program is running `REPEATABLE READ` or `SERIALIZABLE` transactions without retrying them, which is mandatory in those cases, most ORMs will raise an exception with that error message. – Ciro Santilli OurBigBook.com Dec 01 '21 at 21:12

1 Answers1

0

This mean a process is updating a table at the same time with another process. The best thing to do is to check if you don't have setTime or setIntervall or cron working in back, or another app is using your postgresql database.

Abdoulaye BARRY
  • 737
  • 1
  • 7
  • 16