Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040152Openbravo ERPA. Platformpublic2019-02-05 18:122019-03-28 14:56
caristu 
caristu 
immediateminorhave not tried
closedfixed 
5
 
3.0PR19Q2 
alostale
Core
Pre packaging ( pi )
2019-01-31
pi
https://code.openbravo.com/erp/devel/pi/rev/aaa984886667a027a8c99692447febe6e4ca7707 [^]
No
0040152: export.database is slower after defining it as a forked task
The fix for issue 0040047 set the export.database as a forked task. After introducing this change this task has become slower.

This is caused because now a different XML parser is used for reading the XML files that define the database model. (See attached images of the export.database profiling before and after the fix).

Note that the current XML parser factory implementation is org.apache.xerces.jaxp.SAXParserFactoryImpl which is present in the classpath because of the xercesImpl.jar[1]

[1] https://code.openbravo.com/erp/devel/pi/file/tip/lib/runtime/xercesImpl.jar [^]
Prepare two clean environments:

  a) revision: 35384
  b) revision: 35385 [1]

1) In both environments, set all modules in "in development" status and run ant export.database.
2) Check the time spent for the task is higher in environment "b".

[1] https://code.openbravo.com/erp/devel/pi/rev/aaa984886667a027a8c99692447febe6e4ca7707 [^]
Use the same SAXParserFactory[1] that was being used before issue 0040047. There are two possible solutions:

a) Exclude xercesImpl.jar from the classpath used by the task
b) Define a system property in the task to explicitly force the use of the SAXParserFactory implementation being used before:

  <sysproperty key="javax.xml.parsers.SAXParserFactory" value="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl" />

[1] https://docs.oracle.com/javase/8/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance-- [^]
No tags attached.
caused by defect 0040047 closed caristu Fix database export to avoid manually copying wstx-asl-3.0.2.jar inside Ant folder 
related to defect 0040163 closed caristu Do not use xercesImpl XML parser factory in update.database.java task 
png before40047.png (123,234) 2019-02-05 18:15
https://issues.openbravo.com/file_download.php?file_id=12624&type=bug
png

png after40047.png (125,054) 2019-02-05 18:15
https://issues.openbravo.com/file_download.php?file_id=12625&type=bug
png
Issue History
2019-02-05 18:12caristuNew Issue
2019-02-05 18:12caristuAssigned To => caristu
2019-02-05 18:12caristuModules => Core
2019-02-05 18:12caristuTriggers an Emergency Pack => No
2019-02-05 18:15caristuFile Added: before40047.png
2019-02-05 18:15caristuFile Added: after40047.png
2019-02-05 18:16caristuRelationship addedcaused by 0040047
2019-02-05 18:16caristuRegression level => Pre packaging ( pi )
2019-02-05 18:16caristuRegression date => 2019-01-31
2019-02-05 18:16caristuRegression introduced in release => pi
2019-02-05 18:16caristuRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/aaa984886667a027a8c99692447febe6e4ca7707 [^]
2019-02-05 19:10caristuStatusnew => scheduled
2019-02-06 10:47caristuReview Assigned To => alostale
2019-02-06 12:31hgbotCheckin
2019-02-06 12:31hgbotNote Added: 0109626
2019-02-06 12:31hgbotStatusscheduled => resolved
2019-02-06 12:31hgbotResolutionopen => fixed
2019-02-06 12:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/26f426646dc81e7839700507dec84ad5f3931dc0 [^]
2019-02-06 16:10caristuIssue cloned0040163
2019-02-06 16:10caristuRelationship addedrelated to 0040163
2019-02-06 16:14caristuDescription Updatedbug_revision_view_page.php?rev_id=18284#r18284
2019-02-06 16:15caristuDescription Updatedbug_revision_view_page.php?rev_id=18285#r18285
2019-02-06 16:25caristuDescription Updatedbug_revision_view_page.php?rev_id=18290#r18290
2019-02-06 16:25caristuProposed Solution updated
2019-02-11 14:13alostaleNote Added: 0109669
2019-02-11 14:13alostaleStatusresolved => closed
2019-02-11 14:13alostaleFixed in Version => 3.0PR19Q2
2019-03-28 14:56hudsonbotCheckin
2019-03-28 14:56hudsonbotNote Added: 0110800

Notes
(0109626)
hgbot   
2019-02-06 12:31   
Repository: erp/devel/pi
Changeset: 26f426646dc81e7839700507dec84ad5f3931dc0
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Feb 06 12:21:20 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/26f426646dc81e7839700507dec84ad5f3931dc0 [^]

fixes bug 40152: export.database is slower after defining it as a forked task

  The changeset[1] was unintentionally changing the XML parser used by the export tasks. This is because as now they are forked tasks, they make use of their own classpath which includes the xercesImpl library that provides the XML parser that was started to be used after the mentioned changeset.

  We are now setting the javax.xml.parsers.SAXParserFactory system property in order to explicitly set the same XML parser which was being used before because it seems that provides better performance during the XML parsing.

  [1] https://code.openbravo.com/erp/devel/pi/rev/aaa984886667a027a8c99692447febe6e4ca7707 [^]

---
M src-db/database/build.xml
---
(0109669)
alostale   
2019-02-11 14:13   
reviewed + tested
(0110800)
hudsonbot   
2019-03-28 14:56   
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/b2fbc1588df4 [^]
Maturity status: Test