Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2018-11-29 12:172018-12-11 20:22
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR19Q1
StatusclosedFix in branchFixed in SCM revision3ff8ce5616bb
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0039717: unnecesary contention to create new documents in UI

DescriptionIt is not possible to create a new document in UI while there is a transaction holding a lock for that same sequence type.

Steps To Reproduce1. In psql execute and keep it open with the transaction active:
  pi=> begin;
  pi=> select AD_Sequence_DocType('466AF4B0136A4A3F9F84129711DA8BD3', '23C59575B9CF467C9620760EB255B389', 'N');
2. Log in as F&B admin
3. Open Sales Order window
4. Click on new
   -> It is not possible to edit the new record, the UI keeps frozen waiting for default values
5. In pgsql execute commit; to finalize the transaction
   -> Now the default values appear and it is possible to continue
Proposed SolutionThe document proposed in UI on new records is just a proposal which is later properly set when saving the record. So there is no need to wait for locks in ad_sequence, it's better to provide a document number already proposed to a different document to fix it afterwards rather than waiting it to be unlocked.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0039672 closedSandrahuguet Improve contention problems in fin_financial_account 
related to defect 0015801 closedadrianromero the system is blocked when run Create AP Expense Invoices 

-  Notes
hgbot (developer)
2018-12-03 09:57

Repository: erp/devel/pi
Changeset: 3ff8ce5616bb33fc8a92b88fd2dfcda41a2b14f4
Author: Asier Lostalé <asier.lostale <at>>
Date: Fri Nov 30 11:55:27 2018 +0100
URL: [^]

fixed bug 39717: unnecesary contention to create new documents in UI

  AD_Sequence_DocType acquired a "FOR UPDATE" lock whenever it was invoked regardless
  whether it updated the sequence number or only returned a number proposal. The
  latter is the the case of proposing document numbers while creating from UI,
  which was forced to be sequentially executed due to this lock.

  AD_Sequence_DocType behavior has been changed to:
   1. If AD_Sequence_DocType is not going to finally update AD_Sequence, no lock
      is acquired.
   2. Acquire the lock only if AD_Sequence is updated. Even this lock has been
      relaxed in PostgreSQL from FOR UPDATE to FOR NO KEY UPDATE, by doing the
      update (which aquires the lock) before doing the select, which now needs
      to know in which case we are in order to properly calculate the actual

  The same applies to AD_Sequence_Doc.

M src-db/database/model/functions/AD_SEQUENCE_DOC.xml
M src-db/database/model/functions/AD_SEQUENCE_DOCTYPE.xml
Sandrahuguet (developer)
2018-12-05 15:38

Code review + testing OK
hudsonbot (developer)
2018-12-11 20:22

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-11-29 12:17 alostale New Issue
2018-11-29 12:17 alostale Assigned To => platform
2018-11-29 12:17 alostale Modules => Core
2018-11-29 12:17 alostale Triggers an Emergency Pack => No
2018-11-29 12:17 alostale Tag Attached: Performance
2018-11-29 12:17 alostale Relationship added related to 0039672
2018-11-30 11:59 alostale Relationship added related to 0015801
2018-11-30 16:07 galderromo Issue Monitored: galderromo
2018-12-03 09:56 alostale Assigned To platform => alostale
2018-12-03 09:56 alostale Review Assigned To => vmromanos
2018-12-03 09:57 hgbot Checkin
2018-12-03 09:57 hgbot Note Added: 0108221
2018-12-03 09:57 hgbot Status new => resolved
2018-12-03 09:57 hgbot Resolution open => fixed
2018-12-03 09:57 hgbot Fixed in SCM revision => [^]
2018-12-05 12:00 Sandrahuguet Review Assigned To vmromanos => Sandrahuguet
2018-12-05 15:38 Sandrahuguet Note Added: 0108293
2018-12-05 15:38 Sandrahuguet Status resolved => closed
2018-12-05 15:38 Sandrahuguet Fixed in Version => 3.0PR19Q1
2018-12-11 20:22 hudsonbot Checkin
2018-12-11 20:22 hudsonbot Note Added: 0108510

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker