Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037214
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2017-11-02 17:282018-01-03 12:39
ReporteregoitzView Statuspublic 
Assigned Toinigosanchez 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision9ea13ff843c3
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037214: It is possible to produce a server crash executing on the sql query window a query returning thousands of records

DescriptionIf you execute a query on the sql query window that returns thousands of rows the tomcat can stop responding due to high memory usage of the jvm.
Steps To Reproduce1.- Login as "System Administrator - System" in the ERP
2.- Go to [SQL Query] window.
3.- Execute the following sql:
    -> SELECT * FROM ad_field af1, ad_field af2, ad_field af3
4.- Check Tomcat is not responding due to high memory usage of the JVM. Error is raised in the log:

711327 [http-bio-8080-exec-1] ERROR org.openbravo.xmlEngine.ErrorManagement - in designorg/openbravo/erpCommon/ad_forms/SQLExecutor.structureHeader
java.lang.OutOfMemoryError: GC overhead limit exceeded
Dumping heap to java_pid21158.hprof ...
Heap dump file created [1768632959 bytes in 10,052 secs]
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0035838 closedinigosanchez Bad performance in alert window when having +20000 records in ad_alert and many of them are solved 

-  Notes
(0100417)
hgbot (developer)
2017-11-10 10:36

Repository: erp/devel/pi
Changeset: 273381bbd0b51fbbdd92b1ca33bca79e82d16ffd
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Nov 10 10:34:03 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/273381bbd0b51fbbdd92b1ca33bca79e82d16ffd [^]

Related to issue 37214: initial code clean-up
- Removed commented code.
- The showsErrorMessage method is used to avoids duplicate code.
- The errors now are showed to the user.

---
M src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java
---
(0100418)
hgbot (developer)
2017-11-10 10:36

Repository: erp/devel/pi
Changeset: 0a1c870b2e2c159d159edcf062ce72e205c0c7b0
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Nov 10 10:35:18 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0a1c870b2e2c159d159edcf062ce72e205c0c7b0 [^]

Fixed issue 37214: Improved performance in SQL Query manual window

It was possible to produce a server crash executing on the sql query window a query returning
thousands of records. An OutOfMemoryError error is raised although only 20 records were showed
to the user because in fact, all the records were retrieving from the db instead of the 20 needed
records.

In order to fix the performance problem, now the queries are executed as a Native SQL with OFFSET
(org.hibernate.SQLQuery.setFirstResult) and LIMIT (org.hibernate.SQLQuery.setMaxResults). Now the
performance problem has been fixed.

---
M src/org/openbravo/erpCommon/ad_forms/SQLExecutor_Query.java
---
(0100419)
inigosanchez (developer)
2017-11-10 11:14
edited on: 2017-11-10 12:49

Tested in PG 9.4 and ORA 12. Times in org.openbravo.erpCommon.ad_forms.SQLExecutor.doPost:
- With PG 9.4:
 -- Query [1]. Before: OutOfMemoryError. After improvements: 280 ms.
 -- Query [2]. Before: 5577 ms. After improvements: 252 ms.


Queries:
[1] SELECT * FROM AD_FIELD A1, AD_FIELD A2, AD_FIELD A3
[2] SELECT * FROM AD_ORG A1, AD_ORG A2, AD_ORG A3, AD_ORG A4, AD_ORG A5

(0100423)
alostale (manager)
2017-11-10 13:00

reopening due to several problems detected in review:
https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]
(0100522)
hgbot (developer)
2017-11-14 17:16

Repository: erp/devel/pi
Changeset: 9ea13ff843c312c1efb407034ffc46b7dc1d012d
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Tue Nov 14 17:16:19 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9ea13ff843c312c1efb407034ffc46b7dc1d012d [^]

Fixed issue 37214: Code review improvements.

Several changes have been done:
  - Now it is possible to execute a query with a single column in the result because it is take into account when the result has a single column as result.
  - The first column is not ommited and it is shown as expected.
  - Fixed a problem in the export to excel: The first row is not shown in the excel. Now this problem has been fixed.
  - Same errors are shown when clicking on FIND icon or in REFRESH icon.
  - Several unnecessary logs have been removed.
  - The PreparedStatement is closed.

---
M src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java
M src/org/openbravo/erpCommon/ad_forms/SQLExecutor_Query.java
---
(0100538)
hgbot (developer)
2017-11-16 08:49

Repository: erp/devel/pi
Changeset: 2d234dbfd9da1b8e88ec0ccfacb2a8417226ce01
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Nov 16 08:31:03 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2d234dbfd9da1b8e88ec0ccfacb2a8417226ce01 [^]

related to bug 37214: removed printStackTrace

---
M src/org/openbravo/erpCommon/ad_forms/SQLExecutor.java
---
(0100539)
alostale (manager)
2017-11-16 08:50

reviewed + tested
(0101398)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test
(0101399)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test
(0101420)
hudsonbot (developer)
2018-01-03 12:39

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/c81e0d3cbab5 [^]
Maturity status: Test
(0101424)
hudsonbot (developer)
2018-01-03 12:39

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-11-02 17:28 egoitz New Issue
2017-11-02 17:28 egoitz Assigned To => platform
2017-11-02 17:28 egoitz Modules => Core
2017-11-02 17:28 egoitz Resolution time => 1511132400
2017-11-02 17:28 egoitz Triggers an Emergency Pack => No
2017-11-06 13:12 alostale Relationship added related to 0035838
2017-11-06 13:13 alostale Status new => acknowledged
2017-11-06 17:42 egoitz Description Updated View Revisions
2017-11-06 17:42 egoitz Steps to Reproduce Updated View Revisions
2017-11-07 13:34 egoitz Description Updated View Revisions
2017-11-08 17:15 inigosanchez Assigned To platform => inigosanchez
2017-11-08 17:15 inigosanchez Status acknowledged => scheduled
2017-11-08 17:15 inigosanchez Steps to Reproduce Updated View Revisions
2017-11-08 17:28 inigosanchez Steps to Reproduce Updated View Revisions
2017-11-10 09:03 alostale Tag Attached: Performance
2017-11-10 10:36 hgbot Checkin
2017-11-10 10:36 hgbot Note Added: 0100417
2017-11-10 10:36 hgbot Checkin
2017-11-10 10:36 hgbot Note Added: 0100418
2017-11-10 10:36 hgbot Status scheduled => resolved
2017-11-10 10:36 hgbot Resolution open => fixed
2017-11-10 10:36 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0a1c870b2e2c159d159edcf062ce72e205c0c7b0 [^]
2017-11-10 11:14 inigosanchez Note Added: 0100419
2017-11-10 12:49 inigosanchez Note Edited: 0100419 View Revisions
2017-11-10 13:00 alostale Note Added: 0100423
2017-11-10 13:00 alostale Status resolved => new
2017-11-10 13:00 alostale Resolution fixed => open
2017-11-14 16:13 inigosanchez Status new => scheduled
2017-11-14 17:16 hgbot Checkin
2017-11-14 17:16 hgbot Note Added: 0100522
2017-11-14 17:16 hgbot Status scheduled => resolved
2017-11-14 17:16 hgbot Resolution open => fixed
2017-11-14 17:16 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/0a1c870b2e2c159d159edcf062ce72e205c0c7b0 [^] => http://code.openbravo.com/erp/devel/pi/rev/9ea13ff843c312c1efb407034ffc46b7dc1d012d [^]
2017-11-16 08:49 hgbot Checkin
2017-11-16 08:49 hgbot Note Added: 0100538
2017-11-16 08:50 alostale Review Assigned To => alostale
2017-11-16 08:50 alostale Note Added: 0100539
2017-11-16 08:50 alostale Status resolved => closed
2017-11-16 08:50 alostale Fixed in Version => 3.0PR18Q1
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101398
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101399
2018-01-03 12:39 hudsonbot Checkin
2018-01-03 12:39 hudsonbot Note Added: 0101420
2018-01-03 12:39 hudsonbot Checkin
2018-01-03 12:39 hudsonbot Note Added: 0101424


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker