Odoo Help

1

Error: could not serialize access due to concurrent update

By
RockyTang
on 11/9/16, 6:50 AM 1,037 views

We're using odoo v9 to do our business, we developed multiple webservice interface functions based on odoo 9, which is for our mobile app to callback. Such as user login, get cart detail and place orders. And recently we have met some webservice error which is due to sql error "could not serialize access due to concurrent update" which shows in the log, the webservice functions will do some DML sql through odoo ORM, and some through raw sql such as "update table set col=..." and so on.

raw sql sample:

request.cr.execute("""   UPDATE sale_order_line SET price_unit=%s WHERE id=%s; """, (price_unit, order_line_id,))


Here comes my questions:

1> Can we eliminate the "could not serialize access due to concurrent update" error once and for all?


2> If we're not able to eliminate above error and keep using raw sql, is there a way that we can avoid it happening?


Here some log for your reference:

------------------------sample 1------------------------------

2016-10-19 11:58:45,808 107400 WARNING b2bdemo openerp.addons.app_api.models.sale_order: partner.id: 711

2016-10-19 11:58:45,808 107400 WARNING b2bdemo openerp.addons.app_api.models.sale_order: before write res partner

2016-10-19 11:58:45,817 107400 INFO b2bdemo openerp.sql_db: bad query: UPDATE "res_partner" SET "last_website_so_id"=1589,"write_uid"=1,"write_date"=(now() at time zone 'UTC') WHERE id IN (711)

2016-10-19 11:58:45,818 107400 ERROR b2bdemo openerp.addons.app_api.controllers.shopcart: could not serialize access due to concurrent update

-----------------------sample 2--------------------------------

2016-11-07 08:24:02 UTC:172.16.3.55(44117):odoo@b2b:[4206]:LOG:  statement: UPDATE "bus_presence" SET "last_poll"='2016-11-07 08:24:02' WHERE id IN (42)

2016-11-07 08:24:02 UTC:172.16.3.55(44117):odoo@b2b:[4206]:ERROR:  could not serialize access due to concurrent update

2016-11-07 08:24:02 UTC:172.16.3.55(44117):odoo@b2b:[4206]:STATEMENT:  UPDATE "bus_presence" SET "last_poll"='2016-11-07 08:24:02' WHERE id IN (42)

2016-11-07 08:24:03 UTC:172.16.3.55(44117):odoo@b2b:[4206]:LOG:  statement: UPDATE "bus_presence" SET "last_poll"='2016-11-07 08:24:03' WHERE id IN (1)


0
Tim Lai
On 9/4/17, 6:24 AM

Hi

I think there are quite a few similar issues on the forum. the following one might be helpful to your situation.

\https://www.odoo.com/forum/help-1/question/transactionrollbackerror-a-possible-solution-69070

However, I think the module (ref: https://bitbucket.org/xcg/base_res_users_streamline/overview ) is not design for v9, you might need to port the module by yourself.

Regards,

Tim

0
Faycal Sabbane
On 4/20/17, 5:51 AM

Did you find a solution for this issue ?

0
RockyTang
On 11/10/16, 12:40 AM

anyone can help here? much appreciated.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 11/9/16, 6:50 AM
Seen: 1037 times
Last updated: 9/4/17, 6:24 AM