Odoo Help

Welcome!

This community 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.

1

OperationalError: could not obtain lock on row in relation "ir_sequence"

By
Michael Pol
on 5/18/15, 2:37 AM 4,894 views

I have many schedulers which run in background. Few schedulers import thousand of orders daily from different e-commerce channels. These orders are validated and delivered based on order status in Odoo. 

We also create manual refund through Odoo system. Sometimes we get concurrency error when schedulers run in background. This time we got different error of resource sharing.


2015-05-15 18:32:04,222 3333 ERROR DB_Name openerp.sql_db: bad query: SELECT number_next FROM ir_sequence WHERE id=42 FOR UPDATE NOWAIT

Traceback (most recent call last):

File "/path_to_odoo/openerp/sql_db.py", line 234, in execute

res = self._obj.execute(query, params)

OperationalError: could not obtain lock on row in relation "ir_sequence"


When I looked into ir_sequence table I found id 42 is linked with Customer Payments.


id | create_uid | code | create_date | suffix | number_next | number_increment | implementation | company_id | write_uid | padding | active | prefix | write_date | name

----+------------+------+----------------------------+--------+-------------+------------------+----------------+------------+-----------+---------+--------+----------------+----------------------------+------

42 | 1 | | 2014-10-24 10:48:30.265072 | | 197736 | 1 | no_gap | 1 | 1 | 4 | t | BNK2/%(year)s/ | 2014-10-24 10:48:30.265072 | Bank


Can anyone help me to know why threads are not releasing resource after granting lock? Is there any work around for above problem?

0
Kinner Vachhani
On 10/7/15, 4:49 AM

Try changing number_increment to standard. 


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/18/15, 2:37 AM
Seen: 4894 times
Last updated: 10/7/15, 4:49 AM