Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016622Openbravo ERPI. Performancepublic2011-04-03 13:432012-10-13 15:50
eintelau 
alostale 
normalminoralways
closedfixed 
5
pi 
3.0MP16 
AugustoMauch
Core
No
0016622: ReadOnlyDataSourceService doesn't honour the prevent count parameter
The ReadOnlyDataSourceService (in org.openbravo.service.datasource module) doesn't honour the JSON prevent count parameter & always does a count on its results.

This can cause severe performance issues when using a complex query, especially when the datasource implementation can't do the count within the database & has to retrieve all results to provide the count.
1) Create a Reference with a Selector that uses a custom HQL query
2) Apply that reference to a field
3) View a window that uses that field & try to open the selector.
4) With a sufficiently large data set for the query (e.g 100,000's results) you will see the CPU spike & the jvm potentially run out of memory.
Check for the _noCount parameter & prevent the count from occuring when it is present & true.
No tags attached.
related to defect 00166213.0RC7 closed mtaal Selector item does an unnecessary count operation on server 
related to defect 00163733.0MP1 closed gorkaion Product selector & grid not usable when system has large number of products active 
blocks defect 00166113.0RC7 closed mtaal Initial request done by UI selector element in form view does not use any filters or paging 
patch 16622.patch (1,522) 2011-04-03 13:45
https://issues.openbravo.com/file_download.php?file_id=3820&type=bug
Issue History
2011-04-03 13:43eintelauNew Issue
2011-04-03 13:43eintelauAssigned To => dbaz
2011-04-03 13:43eintelauModules => Core
2011-04-03 13:45eintelauFile Added: 16622.patch
2011-04-04 10:56dbazAssigned Todbaz => mtaal
2011-04-05 14:07shuehnerCategoryB. User interface => I. Performance
2011-04-05 17:19shuehnerRelationship addedblocks 0016611
2011-04-11 10:29alostaleStatusnew => scheduled
2011-04-11 15:40mtaalAssigned Tomtaal => alostale
2011-04-26 12:55gorkaionRelationship addedrelated to 0016621
2011-06-17 13:14gorkaionRelationship addedrelated to 0016373
2012-09-07 14:36hgbotCheckin
2012-09-07 14:36hgbotNote Added: 0051939
2012-09-07 14:36hgbotStatusscheduled => resolved
2012-09-07 14:36hgbotResolutionopen => fixed
2012-09-07 14:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d719d893fa76930495cfca884a31d15b1dfdc0d9 [^]
2012-09-13 12:57AugustoMauchClosed by => AugustoMauch
2012-09-13 12:57AugustoMauchNote Added: 0052061
2012-09-13 12:57AugustoMauchStatusresolved => closed
2012-09-13 12:57AugustoMauchFixed in Version => 3.0MP16
2012-09-26 17:18hudsonbotCheckin
2012-09-26 17:18hudsonbotNote Added: 0052716
2012-10-11 17:38hgbotCheckin
2012-10-11 17:38hgbotNote Added: 0053316
2012-10-13 15:50hudsonbotCheckin
2012-10-13 15:50hudsonbotNote Added: 0053334

Notes
(0051939)
hgbot   
2012-09-07 14:36   
Repository: erp/devel/pi
Changeset: d719d893fa76930495cfca884a31d15b1dfdc0d9
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Fri Sep 07 17:05:42 2012 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d719d893fa76930495cfca884a31d15b1dfdc0d9 [^]

Fixes issue 16622 : ReadOnlyDataSourceService doesn't honour the prevent count parameter

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ReadOnlyDataSourceService.java
---
(0052061)
AugustoMauch   
2012-09-13 12:57   
Code reviewed and verified in pi@e4be9ce5c5fa
(0052716)
hudsonbot   
2012-09-26 17:18   
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/b780e90c6452 [^]

Maturity status: Test
(0053316)
hgbot   
2012-10-11 17:38   
Repository: erp/devel/pi
Changeset: ebea3541b581cfd2d5ba3c5645af8a1db1c3c3e9
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Oct 11 17:36:43 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ebea3541b581cfd2d5ba3c5645af8a1db1c3c3e9 [^]

Fixes issue 21910: When a widget is opened in a window it shows all its records

This issue was caused by the fix of the issue 16622. In that issue the ReadOnlyDataSourceServeld was changed so that it kept count of the number of records if the NOCOUNT parameter was set to 'false', as it was done with other datasources. In this case, in order not to break existing calls to the datasource, the count will only be prevented if the parameter is set to 'true', so if the parameter does not have any value (as it is in this scenario of the issue), the count will be done.

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ReadOnlyDataSourceService.java
---
(0053334)
hudsonbot   
2012-10-13 15:50   
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/99e438a6f972 [^]

Maturity status: Test