Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040160Openbravo ERPY. DBSourceManagerpublic2019-02-06 12:542019-03-28 14:56
caristu 
caristu 
highminorhave not tried
closedfixed 
5
 
3.0PR19Q2 
alostale
Core
No
0040160: Avoid delay per exported module in export.database
There is a delay in export.database per exported module. Having a big amount of modules this delay can cause that the task lasting several minutes until it is completed.
1) Set all modules in "in development"
2) Run ant export.database
3) Note that there is a delay per exported module:

     [java] 87769 [main] INFO org.openbravo.ddlutils.task.ExportDatabase - Exporting module: 2.50 to 3.00 Compatibility Skin
     [java] 87779 [main] INFO org.openbravo.ddlutils.task.ExportDatabase - Database [name=PostgreSql server; 551 tables; 0 sequences; 47 views; 311 functions; 319 triggers]
     [java] 90722 [main] INFO org.openbravo.ddlutils.util.DBSMOBUtil - Loading data from XML files <-- Note delay of 2943 milliseconds
....
     [java] 94521 [main] INFO org.openbravo.ddlutils.task.ExportDatabase - Exporting module: Apache External Connection Pool
     [java] 94532 [main] INFO org.openbravo.ddlutils.task.ExportDatabase - Database [name=PostgreSql server; 551 tables; 0 sequences; 47 views; 311 functions; 319 triggers]
     [java] 96271 [main] INFO org.openbravo.ddlutils.util.DBSMOBUtil - Loading data from XML files <-- Note delay of 1739 milliseconds
...
     [java] 96535 [main] INFO org.openbravo.ddlutils.task.ExportDatabase - Exporting module: Core
     [java] 96547 [main] INFO org.openbravo.ddlutils.task.ExportDatabase - Database [name=PostgreSql server; 551 tables; 0 sequences; 47 views; 311 functions; 319 triggers]
     [java] 98047 [main] INFO org.openbravo.ddlutils.util.DBSMOBUtil - Loading data from XML files <-- Note delay of 1500 seconds
...
Performance
related to design defect 0040210 new Triage Platform Base Integrate standard export database process into the DBSM test infrastructure 
related to defect 0040227 closed alostale confusing export.database log 
related to backport 00402353.0PR19Q1 closed caristu Avoid delay per exported module in export.database 
Issue History
2019-02-06 12:54caristuNew Issue
2019-02-06 12:54caristuAssigned To => caristu
2019-02-06 12:54caristuModules => Core
2019-02-06 12:54caristuTriggers an Emergency Pack => No
2019-02-06 13:12caristuDescription Updatedbug_revision_view_page.php?rev_id=18282#r18282
2019-02-06 16:51caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18292#r18292
2019-02-06 16:52caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18293#r18293
2019-02-06 16:53caristuStatusnew => scheduled
2019-02-14 17:25caristuRelationship addedrelated to 0040210
2019-02-14 18:21hgbotCheckin
2019-02-14 18:21hgbotNote Added: 0109843
2019-02-14 18:21hgbotStatusscheduled => resolved
2019-02-14 18:21hgbotResolutionopen => fixed
2019-02-14 18:21hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/aa473ad13ee3bbd7b52363a2d38d5423c143d34a [^]
2019-02-14 18:21hgbotCheckin
2019-02-14 18:21hgbotNote Added: 0109844
2019-02-14 18:23hgbotCheckin
2019-02-14 18:23hgbotNote Added: 0109845
2019-02-14 18:24caristuReview Assigned To => alostale
2019-02-15 11:04alostaleNote Added: 0109855
2019-02-15 11:04alostaleStatusresolved => closed
2019-02-15 11:04alostaleFixed in Version => 3.0PR19Q2
2019-02-18 09:21alostaleRelationship addedrelated to 0040227
2019-02-18 16:02caristuIssue cloned0040235
2019-02-18 16:02caristuRelationship addedrelated to 0040235
2019-02-18 16:04caristuTag Attached: Performance
2019-03-28 14:56hudsonbotCheckin
2019-03-28 14:56hudsonbotNote Added: 0110817

Notes
(0109843)
hgbot   
2019-02-14 18:21   
Repository: erp/devel/dbsm-main
Changeset: aa473ad13ee3bbd7b52363a2d38d5423c143d34a
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Feb 14 17:59:31 2019 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/aa473ad13ee3bbd7b52363a2d38d5423c143d34a [^]

fixes bug 40160: Avoid delay per exported module in export.database

  Before exporting the source data of the modules in "in development" status, the model is reloaded from the previously exported XML model files. This is done to ensure that the source data is exported using the same order of the columns which is defined in the XML files, instead of using the order in the database because this can be different.

  For example, the order can be different in the database when adding a new column to a table. The new column will be added at the last position, because the table will not be recreated. But if this new column is not the last one in the XML file that defines the table, then under this scenario the order of the columns in the database will be different from the order in the XML file.

  This model reloading was being done per every module being exported. This is not needed as the model does not change at this point, so it can be reloaded just once, right before starting the exportation of the source data.

---
M src/org/openbravo/ddlutils/task/ExportDatabase.java
---
(0109844)
hgbot   
2019-02-14 18:21   
Repository: erp/devel/dbsm-main
Changeset: 99d740ff328656b961560e274c6f357c1430461f
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Feb 14 18:16:46 2019 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/99d740ff328656b961560e274c6f357c1430461f [^]

related to issue 40160: add test case

 This test should be completed once the test infrastructure is ready for it. See issue https://issues.openbravo.com/view.php?id=40210 [^]

---
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
A src-test/data/columnOrder/TEST.xml
A src-test/src/org/openbravo/dbsm/test/model/recreation/ColumnOrderOnExport.java
---
(0109845)
hgbot   
2019-02-14 18:23   
Repository: erp/devel/pi
Changeset: 48bd5af1230a00751aa8aae225519a9451af1267
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Feb 14 18:23:00 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/48bd5af1230a00751aa8aae225519a9451af1267 [^]

related to issue 40160: Update DBSM library

---
M src-db/database/lib/dbsourcemanager.jar
---
(0109855)
alostale   
2019-02-15 11:04   
reviewed + tested
(0110817)
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