Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028360Openbravo ERP07. Sales managementpublic2014-12-09 08:572014-12-30 23:27
alostale 
Sandrahuguet 
immediatemajorhave not tried
closedfixed 
5
 
pi 
umartirena
Core
Production - Confirmed Stable
2012-06-18
3.0MP13
https://code.openbravo.com/erp/devel/pi/rev/3c283da21351 [^]
Yes
0028360: c_order_post creates unnecesary contention on m_pricelist
c_order_post procedure unnecessarily locks m_pricelist table (with a select for update).

This, potentially, causes a big contention.

Testing in postgresql, while completing an order it is not possible to do the following actions in parallel:

Pg 9.2
* Create new Order with same price list
* Create new Sales Invoice with same price list
* Create new Order Line
* Post another order
* Post another invoice

Pg 9.3
* Create new Order with same price list
* Create new Sales Invoice with same price list
* Post another order
* Post another invoice

Not tested in Oracle yet
-Create a new Sales Order with lines (check its price list)
-In a pg client (psql) run:
  begin
    select c_order_post1(null, (select c_order_id from c_order order by created desc limit 1), null);

(Note session is intentionally kept open to simulate slowness)
-Do the actions described in the description
Performance
related to defect 0028362 closed Sandrahuguet c_invoice_post creates unnecesary contention on m_pricelist and c_doctype 
related to defect 0028363 new Triage Omni OMS check contention due to select for update 
related to defect 0028364 new Triage Omni OMS c_order post locks some master tables 
Issue History
2014-12-09 08:57alostaleNew Issue
2014-12-09 08:57alostaleAssigned To => dmiguelez
2014-12-09 08:57alostaleModules => Core
2014-12-09 08:57alostaleRegression level => Production - Confirmed Stable
2014-12-09 08:57alostaleRegression date => 2012-06-18
2014-12-09 08:57alostaleRegression introduced in release => 3.0MP13
2014-12-09 08:57alostaleTriggers an Emergency Pack => No
2014-12-09 08:57alostaleAssigned Todmiguelez => Sandrahuguet
2014-12-09 08:57alostaleTag Attached: Performance
2014-12-09 08:58alostaleIssue Monitored: alostale
2014-12-09 08:58alostaleTriggers an Emergency PackNo => Yes
2014-12-09 08:59alostaleRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/3c283da21351 [^]
2014-12-09 10:05alostaleRelationship addedrelated to 0028362
2014-12-09 12:30alostaleRelationship addedrelated to 0028363
2014-12-09 12:36alostaleRelationship addedrelated to 0028364
2014-12-10 10:21SandrahuguetNote Added: 0072377
2014-12-10 10:30hgbotCheckin
2014-12-10 10:30hgbotNote Added: 0072379
2014-12-10 10:30hgbotStatusnew => resolved
2014-12-10 10:30hgbotResolutionopen => fixed
2014-12-10 10:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6b10d4a9385d322f75c127b007ddf8f49caa0439 [^]
2014-12-10 13:56umartirenaReview Assigned To => umartirena
2014-12-10 13:56umartirenaNote Added: 0072397
2014-12-10 13:56umartirenaStatusresolved => closed
2014-12-10 13:56umartirenaFixed in Version => pi
2014-12-30 23:27hudsonbotCheckin
2014-12-30 23:27hudsonbotNote Added: 0073201

Notes
(0072377)
Sandrahuguet   
2014-12-10 10:21   
Test Plan:
-Create a new Sales Order with lines (check its price list)
-In a pg client (psql) run:
  begin
    select c_order_post1(null, (select c_order_id from c_order order by created desc limit 1), null);
- Create new Order with same price list
- Create new Sales Invoice with same price list
(0072379)
hgbot   
2014-12-10 10:30   
Repository: erp/devel/pi
Changeset: 6b10d4a9385d322f75c127b007ddf8f49caa0439
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Dec 09 18:55:38 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6b10d4a9385d322f75c127b007ddf8f49caa0439 [^]

Fixed bug 28360 c_order_post creates unnecesary contentions

Avoiding the join with m_pricelist the m_pricelist contention is solved

For update sentence is deleted in c_orderline selects because the
c_orderline is bloqued with the main select and is redundant and
causes unnecessary contentions.

---
M src-db/database/model/functions/C_ORDER_POST1.xml
---
(0072397)
umartirena   
2014-12-10 13:56   
Code Review + Testing OK
(0073201)
hudsonbot   
2014-12-30 23:27   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/6525fe229e06 [^]
Maturity status: Test