Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036112Openbravo ERPA. Platformpublic2017-05-25 19:242017-09-28 18:14
shuehner 
inigosanchez 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0036112: excludeFilter + manual db object creation does not work when installing module during install.source
When a module for a specific reason needs to create the database object manually (i.e. because update.database does not support a feature) that is possible by using combination of
a.) excludeFilter xml entry
b.) ModuleScript doing manual ddl (i.e. create function)

That does not work when installing module directly during install.source see below for longer version.

During a normal module installation with update.database that causes following steps
a.) update.database itself does not touch the excluded objects
b.) ModuleScript running during update.database creates extra objects
c.) end of update.database db-checksum is calculated
=> Checksum + database are in sync

However when placing a module in modules/ folder and running install.source sequence is different
1.) create.database creates all normal objects + calculates checksum
=> here checksum is in sync with database
2.) during import.sampledata modulescripts are run creating extra db objects
=> now database is no longer in sync with stored checksum
i.e. clone following snapshot from swf-utils report useing CodeSnapshot.sh tool
delivery_pilot_6/Snapshot_Q2_20170512_01 (needs pg>=9.5)

a.)
Run install.source
run update.database
It will fail with local changes

b.)
Running install.source without running modulescript
running update.database
=> No local changes

that *but.migration module inside shows the reported issue
Recalculate checksum at end of install.source to ensure it is in sync even when structure is modified during modulescripts
No tags attached.
related to defect 0036137 closed inigosanchez Openbravo ERP [SER-QA 2918] Config script removeCheckChange are not applied on install.source 
has duplicate defect 0036865 closed inigosanchez Openbravo ERP false DB modified positive detected after compile.complete having the activiti module 
related to defect 0036885 closed inigosanchez Modules Remove a call to the DBSMOBUtil.getInstance().updateCRC(platform) deprecated method. 
Issue History
2017-05-25 19:24shuehnerNew Issue
2017-05-25 19:24shuehnerAssigned To => platform
2017-05-25 19:24shuehnerModules => Core
2017-05-25 19:24shuehnerTriggers an Emergency Pack => No
2017-05-25 19:24shuehnerNote Added: 0096821
2017-06-02 11:27alostaleStatusnew => acknowledged
2017-06-02 11:27alostaleRelationship addedrelated to 0036137
2017-09-11 15:54inigosanchezStatusacknowledged => scheduled
2017-09-11 15:54inigosanchezAssigned Toplatform => inigosanchez
2017-09-15 11:41inigosanchezNote Added: 0099066
2017-09-15 11:41inigosanchezReview Assigned To => caristu
2017-09-15 12:35caristuRelationship addedrelated to 0036865
2017-09-18 09:34hgbotCheckin
2017-09-18 09:34hgbotNote Added: 0099089
2017-09-18 09:34hgbotCheckin
2017-09-18 09:34hgbotNote Added: 0099090
2017-09-18 09:34hgbotCheckin
2017-09-18 09:34hgbotNote Added: 0099091
2017-09-18 09:34hgbotStatusscheduled => resolved
2017-09-18 09:34hgbotResolutionopen => fixed
2017-09-18 09:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/036c566707b4bd4c6ca6c6c129d38c1b2adda59f [^]
2017-09-18 09:41hgbotCheckin
2017-09-18 09:41hgbotNote Added: 0099092
2017-09-18 09:41hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/036c566707b4bd4c6ca6c6c129d38c1b2adda59f [^] => http://code.openbravo.com/erp/devel/pi/rev/bd3b87f44dea7e6ced05c0023c5755ad4cfafdd3 [^]
2017-09-18 13:49inigosanchezRelationship replacedhas duplicate 0036865
2017-09-18 17:31inigosanchezNote Edited: 0099066bug_revision_view_page.php?bugnote_id=0099066#r15927
2017-09-19 10:30inigosanchezRelationship addedrelated to 0036885
2017-09-21 16:50hudsonbotCheckin
2017-09-21 16:50hudsonbotNote Added: 0099401
2017-09-22 11:28caristuNote Added: 0099475
2017-09-22 12:28caristuStatusresolved => new
2017-09-22 12:28caristuResolutionfixed => open
2017-09-22 12:46inigosanchezStatusnew => scheduled
2017-09-22 13:20hgbotCheckin
2017-09-22 13:20hgbotNote Added: 0099483
2017-09-22 13:33hgbotCheckin
2017-09-22 13:33hgbotNote Added: 0099485
2017-09-22 13:34inigosanchezStatusscheduled => resolved
2017-09-22 13:34inigosanchezResolutionopen => fixed
2017-09-25 14:30hudsonbotCheckin
2017-09-25 14:30hudsonbotNote Added: 0099551
2017-09-27 11:39hgbotCheckin
2017-09-27 11:39hgbotNote Added: 0099625
2017-09-27 11:43hgbotCheckin
2017-09-27 11:43hgbotNote Added: 0099626
2017-09-28 10:03hgbotCheckin
2017-09-28 10:03hgbotNote Added: 0099642
2017-09-28 10:11hgbotCheckin
2017-09-28 10:11hgbotNote Added: 0099643
2017-09-28 15:35hudsonbotCheckin
2017-09-28 15:35hudsonbotNote Added: 0099657
2017-09-28 15:35hudsonbotCheckin
2017-09-28 15:35hudsonbotNote Added: 0099659
2017-09-28 18:14caristuNote Added: 0099666
2017-09-28 18:14caristuStatusresolved => closed
2017-09-28 18:14caristuFixed in Version => 3.0PR17Q4

Notes
(0096821)
shuehner   
2017-05-25 19:24   
Notes:
-> skip modulescripts during install.source -> should still run update checksum
-> run import.sampledata manually (i.e. to add whitevalley sampledata) after installing retail -> should we run checksum again?
(0099066)
inigosanchez   
2017-09-15 11:41   
(edited on: 2017-09-18 17:31)
Test plan:
- Common case: Execute normal install.source execution -> Result of ad_db_modified() execution -> N
- Reported case: Execute install.source task having a modulescript that creates a table (the table should be added to excludeFilter too -> as a excludedTable). Result of ad_db_modified() execution -> N
- DBSMTestSuite suite is executed successfully -> OK


The checksum always is in sync (at end of install.source) even when db structure is modified during modulescripts.

(0099089)
hgbot   
2017-09-18 09:34   
Repository: erp/devel/dbsm-main
Changeset: 2a50ac50cac648856f3dcfb2838c847d3644a0d8
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 14 13:22:49 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/2a50ac50cac648856f3dcfb2838c847d3644a0d8 [^]

Related with issue 36112: code clean up

- The hasBeenModified method had several outdate code. Remove all unused code.
- The getDependencyHashMap() private method is unused locally: removed it. Also remove all code
which was only used by that method: another private method called getDependencyForPrefix().
- Remove private vector: idDependantModules. It is unused.

---
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0099090)
hgbot   
2017-09-18 09:34   
Repository: erp/devel/dbsm-main
Changeset: 59bf74769dd565c6be611f7e6ee52bdc75eb30e9
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Sep 15 13:45:58 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/59bf74769dd565c6be611f7e6ee52bdc75eb30e9 [^]

Related with issue 36112: deprecated two methods in DBSMOBUtil

These two methods are deprecated because platform is not used in the code:
- updateCRC(Platform platform)
- hasBeenModified(Platform platform, OBDataset dataset, boolean updateCRC)

They are maintained in the code as deprecated in order to maintain backwards compatibility
and to ensures that the API is not broken.

---
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
M src/org/openbravo/ddlutils/task/ExportConfigScript.java
M src/org/openbravo/ddlutils/task/ExportDatabase.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0099091)
hgbot   
2017-09-18 09:34   
Repository: erp/devel/dbsm-main
Changeset: 036c566707b4bd4c6ca6c6c129d38c1b2adda59f
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Sep 15 13:47:05 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/036c566707b4bd4c6ca6c6c129d38c1b2adda59f [^]

Fixed issue 36112: Checksum is updated properly on install source task

The problem was that checksum was not updated on install source task. The problem was
in ImportSampledata because this task can execute module scripts that modifies the
database. (e.g. create or modified a table).

The problem has been resolved by take into account this situation. Now the checksum is
calculated after the modules script are executed.

---
M src/org/openbravo/ddlutils/task/ImportSampledata.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0099092)
hgbot   
2017-09-18 09:41   
Repository: erp/devel/pi
Changeset: bd3b87f44dea7e6ced05c0023c5755ad4cfafdd3
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Mon Sep 18 09:40:40 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bd3b87f44dea7e6ced05c0023c5755ad4cfafdd3 [^]

Fixed issue 36112: Checksum is updated properly on install source task

The problem was that checksum was not updated on install source task. The problem was
in ImportSampledata because this task can execute module scripts that modifies the
database. (e.g. create or modified a table).

The problem has been resolved by take into account this situation. Now the checksum is
calculated after the modules script are executed.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099401)
hudsonbot   
2017-09-21 16: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/9750b78d3e5c [^]
Maturity status: Test
(0099475)
caristu   
2017-09-22 11:28   
Minor code review improvements:

https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]
(0099483)
hgbot   
2017-09-22 13:20   
Repository: erp/devel/dbsm-main
Changeset: f9da225c2a26bb499efa0e1f6a3eb336ec5c353f
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Sep 22 13:00:43 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/f9da225c2a26bb499efa0e1f6a3eb336ec5c353f [^]

Related with issue 36112: Minor code review improvements

- Some typos are fixed.
- Improved the name of a method.
- Use getLog().error instead of System.out.
- Now invokeAdDbModified method only execute ad_db_modify('N'). Updated its name to isAdDbModified. Reverted changes in updatedCRC method.

---
M src/org/openbravo/ddlutils/task/ImportSampledata.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0099485)
hgbot   
2017-09-22 13:33   
Repository: erp/devel/pi
Changeset: 262f8744d1996bf16276a989e7305a9fe1f7b99f
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Sep 22 13:14:08 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/262f8744d1996bf16276a989e7305a9fe1f7b99f [^]

Related with issue 36112: Minor code review improvements

- Some typos are fixed.
- Improved the name of a method.
- Use getLog().error instead of System.out.
- Now invokeAdDbModified method only execute ad_db_modify('N'). Updated its name to isAdDbModified. Reverted changes in updatedCRC method.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099551)
hudsonbot   
2017-09-25 14:30   
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/d8fd6d1ecc14 [^]
Maturity status: Test
(0099625)
hgbot   
2017-09-27 11:39   
Repository: erp/devel/dbsm-main
Changeset: 8d4e306dd2a7d479d1e5c7efde5291f885c3cf2d
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Sep 27 10:35:08 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/8d4e306dd2a7d479d1e5c7efde5291f885c3cf2d [^]

Related with issue 36112: code review improvements

- Improved a message in ImportSampledata.
- Deprecated hasBeenModified(OBDataset, boolean) method because boolean is not used anymore.

---
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
M src/org/openbravo/ddlutils/task/ImportSampledata.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0099626)
hgbot   
2017-09-27 11:43   
Repository: erp/devel/pi
Changeset: 813c115641f1117953b683f25356083861357b24
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Sep 27 11:23:03 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/813c115641f1117953b683f25356083861357b24 [^]

Related with issue 36112: code review improvements

- Improved a message in ImportSampledata.
- Deprecated hasBeenModified(OBDataset, boolean) method because boolean is not used anymore.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099642)
hgbot   
2017-09-28 10:03   
Repository: erp/devel/dbsm-main
Changeset: 7e65e43ae85c33b8918975c3493a813541e5ba41
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 28 09:44:55 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/7e65e43ae85c33b8918975c3493a813541e5ba41 [^]

Related with bug 36112: Remove deprecated method introduced in the code cleanup

Remove deprecated method that was included as a part of the code cleanup of this issue. For this reason, the method can be removed.

---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0099643)
hgbot   
2017-09-28 10:11   
Repository: erp/devel/pi
Changeset: 7e1efd1528f2ba85da80fb5391394d5dfa24f097
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 28 09:48:22 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7e1efd1528f2ba85da80fb5391394d5dfa24f097 [^]

Related with bug 36112: Remove deprecated method introduced in the code cleanup

Remove deprecated method that was included as a part of the code cleanup of this issue. For this reason, the method can be removed.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099657)
hudsonbot   
2017-09-28 15:35   
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/269dfb9e8626 [^]
Maturity status: Test
(0099659)
hudsonbot   
2017-09-28 15:35   
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/269dfb9e8626 [^]
Maturity status: Test
(0099666)
caristu   
2017-09-28 18:14   
Reviewed + tested OK.