Openbravo Issue Tracking System - Modules
View Issue Details
0033294ModulesNot Posted Transactionspublic2016-06-16 17:012016-09-25 21:43
maite 
markmm82 
urgentmajoralways
closedfixed 
5
 
 
vmromanos
0033294: Performance problem in Report Not Posted window due to large amount of data
Performance problem in Report Not Posted window due to large amount of data
0. Install last version 1.0.100 where another performance improvement was included
1. Realize that window stays in "loading data" although no petition is pending in developers tool's console. Datasource requests finish has following response: {"response":{"status":-4,"error":{"type":"system"}}}
No tags attached.
related to defect 0031840 closed vmromanos Error Out of memory trying to open the Report not posted window 
Issue History
2016-06-16 17:01maiteNew Issue
2016-06-16 17:01maiteAssigned To => Triage Finance
2016-06-16 17:02maiteResolution time => 1467756000
2016-06-16 17:05maiteRelationship addedrelated to 0031840
2016-06-17 10:27aferrazAssigned ToTriage Finance => markmm82
2016-06-30 15:03markmm82Statusnew => scheduled
2016-07-05 18:17markmm82Note Added: 0088220
2016-07-07 09:49hgbotCheckin
2016-07-07 09:49hgbotNote Added: 0088258
2016-07-07 09:49hgbotStatusscheduled => resolved
2016-07-07 09:49hgbotResolutionopen => fixed
2016-07-07 09:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.financialmgmt.accounting.report.notposted/rev/5c5b93ad72146992c9eacfce87aeb6a9be2af17f [^]
2016-07-07 10:02vmromanosReview Assigned To => vmromanos
2016-07-07 10:02vmromanosNote Added: 0088259
2016-07-07 10:02vmromanosStatusresolved => closed
2016-09-25 21:43eugeniIssue Monitored: eugeni

Notes
(0088220)
markmm82   
2016-07-05 18:17   
Test Plan:
0. Install last version of the "Not Posted Transactions" module (1.0.200)

As Group Admin
1. Go to "Report Not Posted" window.
2. Notice that window load records successfully.
3. Scroll the grid. Notice that more records are loaded.
4. Go to "Sales Invoice" window, create a header
    Invoice Date: today,
    Organization: F&B España - Región Norte
5. Add any line and complete the invoice. Don't post it.
6. Go to "Report Not Posted" window.
7. Filter by Organization: F&B España - Región Norte and Accounting Date: today.
8. Notice that the previously created invoice is shown.
9. Select the invoice and press "post" button.
10. Notice the invoice is posted and it is no longer in the grid.
(0088258)
hgbot   
2016-07-07 09:49   
Repository: erp/mods/org.openbravo.financialmgmt.accounting.report.notposted
Changeset: 5c5b93ad72146992c9eacfce87aeb6a9be2af17f
Author: Mark <markmm82 <at> gmail.com>
Date: Wed Jul 06 13:02:34 2016 -0400
URL: http://code.openbravo.com/erp/mods/org.openbravo.financialmgmt.accounting.report.notposted/rev/5c5b93ad72146992c9eacfce87aeb6a9be2af17f [^]

Fixes issue 33294: Performance problem in Report Not Posted window

Fixed the performance problem in Report Not Posted window due to large amount of data. The performance problems were caused due to the getCount method, it was iterating for the entire result set every time the Datasource was invoked. In cases when the environment has high volumes of data, this operation is expense and cause delays and other performance issues.

This solution includes:
-The code was cleaned, removing some methods not necessary for the solution.
-Reused methods of the ReadOnlyDataSourceService and redefined some the parameters for fetching data correctly when page is scrolled.
-Overwrite the getCount and fetch methods, to obtain best performance when the ReadOnlyDataSourceService is invoked.
-It takes into account records added in previous calls to the datasource (when the page is scrolled), avoiding to repeat records previously added to the page.
-Updated module version to 1.1.0 because has been modified the public API.

---
M src-db/database/sourcedata/AD_MODULE.xml
M src/org/openbravo/financialmgmt/accounting/report/notposted/NotPostedDocumentsDataSource.java
---
(0088259)
vmromanos   
2016-07-07 10:02   
Code review + testing OK

Fixed in module version 1.1.0 (or higher).


Please note that this report is not thought for managing high volumes, but to detect small problems for concrete transactions. The more records you show in the grid, the worse performance you will get.

Besides, tested in the customer environment that reported the issue I realized that:
1. The report shows UUIDs in most of the records because the instance has a template that modifies the "use as record identifier" flags in some transactional tables (like match invoice)
2. There is no link to the document type because the instance doesn't use the standard document types provided by Openbravo and they miss some document types, for example, for Match Invoice.
3. You can reduce the number of records shown in the report by deactivating the correspondent General Ledger table.