Openbravo Issue Tracking System - Modules
View Issue Details
0035127ModulesRemittancepublic2017-02-01 12:382017-02-16 09:32
egoitz 
vmromanos 
normalmajoralways
closedduplicate 
5
 
 
45320
vmromanos
0035127: Performance problems adding order or invoices to a remmitance
when there are a thousands of payment ins the grid of the add order or invoices popup takes long to be loaded if you click on the show alternative check box.
Open the popup on an environment with a lot of payment in pending (pending sales invoices)
No tags attached.
duplicate of feature request 0022207 new Triage Omni OMS Select Orders or Invoices through the Pick and Execute pattern 
related to design defect 0022330 new Triage Omni OMS Improve performance first time you click on "select orders or invoices" button in Remittance header 
diff 35127_core.diff (669) 2017-02-16 09:31
https://issues.openbravo.com/file_download.php?file_id=10453&type=bug
diff 35127_safe.diff (1,916) 2017-02-16 09:32
https://issues.openbravo.com/file_download.php?file_id=10454&type=bug
diff 35127_risky.diff (46,218) 2017-02-16 09:32
https://issues.openbravo.com/file_download.php?file_id=10455&type=bug
Issue History
2017-02-01 12:38egoitzNew Issue
2017-02-01 12:38egoitzAssigned To => platform
2017-02-01 12:38egoitzRegression introduced by commit => 45320
2017-02-01 12:38egoitzResolution time => 1488322800
2017-02-01 12:39egoitzAssigned Toplatform => Triage Finance
2017-02-01 12:39egoitzCategoryNew selectors => Remittance
2017-02-01 12:40egoitzNote Added: 0093984
2017-02-13 17:12vmromanosNote Added: 0094275
2017-02-13 17:12vmromanosRelationship addedrelated to 0022207
2017-02-13 17:13vmromanosRelationship addedrelated to 0022330
2017-02-13 21:56markmm82Assigned ToTriage Finance => Sanjota
2017-02-14 09:17jmonfortIssue Monitored: jmonfort
2017-02-14 09:53vmromanosAssigned ToSanjota => vmromanos
2017-02-15 11:27vmromanosStatusnew => acknowledged
2017-02-16 09:08vmromanosStatusacknowledged => scheduled
2017-02-16 09:30vmromanosReview Assigned To => vmromanos
2017-02-16 09:31vmromanosRelationship replacedduplicate of 0022207
2017-02-16 09:31vmromanosNote Added: 0094379
2017-02-16 09:31vmromanosStatusscheduled => closed
2017-02-16 09:31vmromanosResolutionopen => duplicate
2017-02-16 09:31vmromanosFile Added: 35127_core.diff
2017-02-16 09:32vmromanosFile Added: 35127_safe.diff
2017-02-16 09:32vmromanosFile Added: 35127_risky.diff

Notes
(0093984)
egoitz   
2017-02-01 12:40   
You can get also a out of memory error depending on the volume of payments
(0094275)
vmromanos   
2017-02-13 17:12   
Please note there is a feature request 0022207 that is the right way to fix this issue. Besides there is a design defect 0022330 related to this topic.

That means that we will try to fix this issue only if it's easy & fast. Spending too much time in this piece of code doesn't make sense and it would be better to work on the redesign instead.
(0094379)
vmromanos   
2017-02-16 09:31   
Rejected as duplicated of 0022207

There are two issues that both must be fixed at the same time to make this window working with very high volumens:

1. The Java code doesn't properly manage memory, loading too many records in Hibernate memory, killing the server with high volumens.
Besides the process launches too many queries to the database to get the info to be printed in the grid. This makes the process very slow and also contributes to out of memory problems.

2. The grid where the lines are displayed is not ready for working with high volumens, because it doesn't implement pagination. Thus, if the instance has many lines to shown, it kills the browser trying to render all of them.


In the customer environment that reports this issue there are a total of more than 83K records to display. My browser is unable to render more than 2K records at the same time.

The proper way to fix this is by implementing 0022207.


As a workaround for this problem meanwhile 0022207 is not fixed, I have attached 2 solutions for this problem: the safe one (35127_core.diff + 35127_safe.diff) and the risky one (35127_core.diff + 35127_risky.diff):

* Safe solution: adds an index to core, refactors a query that had important performance problems and, the most important part, adds a limit of 1K records to be shown. This way we workaround problems explained in #1 and #2 and the user can start creating remittance batches of 1K records.

* Risky solution: adds an index to core, heavily refactor Java code to improve memory management (with this patch we fix Out of Memory exceptions) and to improve SQL performance (now the process is finished in less than 15 seconds in my test for the 83K records). However it has two important problems: it might introduce regressions because the changes are really major and it won't fix the browser rendering problems, so depending on the number of records your browser will probably crash.


As a conclusion, I would recommend to apply the safe patch and work in batches of 1K records.
This window is clearly obsolete and should be refactor instead of investing more time