Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0044892Openbravo ERPY. DBSourceManagerpublic2020-08-26 10:282022-11-03 12:41
caristu 
alostale 
highminorN/A
closedfixed 
5
 
PR23Q1 
Core
No
0044892: On install.source config scripts are applied in two steps
On install.source config scripts are applied in two steps:

1. creates the DB without applying scripts [1]
2. applies the config scripts

This two step process may be problematic, in particular in Oracle if the config script is making changes in columns that participate in functional indexes. In that case Oracle does not allow to change the column (in step 2) as reported in issue 0044612.

[1] https://gitlab.com/openbravo/projects/platform/dbsm/-/blob/master/src/org/openbravo/ddlutils/task/CreateDatabase.java#L124 [^]
1- Modify on a template a column that is used in functional index. For example the column name of C_BPartner:
     <columnSizeChange tablename="C_BPARTNER" columnname="NAME" newSize="120" oldSize="60"/>
2- run ant install.source
  ERROR: ORA-30556
1) Review if there is any reason why we are doing this in two steps (historical reasons?)
2) Read the whole model at once including the config scripts and create the database with all the information in a shot
No tags attached.
related to defect 0044612 new Triage Platform Base ORA fails applying changes to columns used in functional indexes 
related to feature request 0044896 new Triage Platform Base Add check for dangerous operations in update.database task 
related to defect 0044901 closed Triage Platform Base PostgreSQL fails applying changes to columns used in views (during install.source) 
related to defect 0045318 new Triage Platform Base NullPointerException during create.database with configScript doing model changes of non existing db objects 
causes defect 0050729 closed caristu org.openbravo.reporting.tools fails to compile 
Issue History
2020-08-26 10:28caristuNew Issue
2020-08-26 10:28caristuAssigned To => platform
2020-08-26 10:28caristuModules => Core
2020-08-26 10:28caristuTriggers an Emergency Pack => No
2020-08-26 10:28caristuRelationship addedrelated to 0044612
2020-08-26 11:29caristuDescription Updatedbug_revision_view_page.php?rev_id=21545#r21545
2020-08-26 11:43caristuIssue cloned0044896
2020-08-26 11:43caristuRelationship addedrelated to 0044896
2020-08-26 14:41shuehnerRelationship addedrelated to 0044901
2020-10-29 13:48alostaleRelationship addedrelated to 0045318
2022-02-01 07:24alostaleAssigned Toplatform => Triage Platform Base
2022-10-27 09:40hgbotNote Added: 0142631
2022-10-28 08:27hgbotNote Added: 0142700
2022-11-02 07:36alostaleAssigned ToTriage Platform Base => alostale
2022-11-02 07:37alostaleStatusnew => scheduled
2022-11-03 12:40hgbotResolutionopen => fixed
2022-11-03 12:40hgbotStatusscheduled => closed
2022-11-03 12:40hgbotNote Added: 0142870
2022-11-03 12:40hgbotNote Added: 0142873
2022-11-03 12:40hgbotNote Added: 0142874
2022-11-03 12:41hgbotNote Added: 0142876
2022-11-03 12:41hgbotFixed in Version => PR23Q1
2022-11-03 12:41hgbotNote Added: 0142877
2022-11-04 09:22alostaleRelationship addedcauses 0050729

Notes
(0142631)
hgbot   
2022-10-27 09:40   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/36 [^]
(0142700)
hgbot   
2022-10-28 08:27   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/743 [^]
(0142870)
hgbot   
2022-11-03 12:40   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: 8a88bde77869ec36162052d118c4069980732813
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 03-11-2022 11:24:30
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/8a88bde77869ec36162052d118c4069980732813 [^]

fixes ISSUE-44892: on DB creation config scripts are applied in two steps

When creating database, the database model was created in two steps:

  1. model creation without taking into account config scripts
  2. config script changes (model and data) were applied

This can cause different problems.

Now the process is more like:

  1. read in memory model without config script changes
  2. read config script model changes and apply them in memory model
  3. create complete model in DB
  4. read and apply data in DB without config script changes
  5. read and apply in DB data config script changes

---
M src/org/openbravo/ddlutils/task/CreateDatabase.java
---
(0142873)
hgbot   
2022-11-03 12:40   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: 40ea1bfdbbe63ee46c2a360a6fd63f0d7bf00800
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 03-11-2022 12:34:31
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/40ea1bfdbbe63ee46c2a360a6fd63f0d7bf00800 [^]

fixes ISSUE-44892: on DB creation config scripts are applied in two steps

When creating database, the database model was created in two steps:

  1. model creation without taking into account config scripts
  2. config script changes (model and data) were applied

This can cause different problems.

Now the process is more like:

  1. read in memory model without config script changes
  2. read config script model changes and apply them in memory model
  3. create complete model in DB
  4. read and apply data in DB without config script changes
  5. read and apply in DB data config script changes

---
A src-test/model/configScripts/BASE_MODEL_FUNCT_IDX.xml
A src-test/model/configScripts/BASE_MODEL_VIEW.xml
A src/org/openbravo/ddlutils/process/DBCreator.java
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnSizeChange.java
M src/org/openbravo/ddlutils/process/DBUpdater.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterXML2SQL.java
M src/org/openbravo/ddlutils/task/BaseDatabaseTask.java
M src/org/openbravo/ddlutils/task/CreateDatabase.java
M src/org/openbravo/ddlutils/task/DatabaseUtils.java
---
(0142874)
hgbot   
2022-11-03 12:40   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/36 [^]
(0142876)
hgbot   
2022-11-03 12:41   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/743 [^]
(0142877)
hgbot   
2022-11-03 12:41   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 7707245518817c0416ef2fec0bad00d11c2afa56
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 03-11-2022 11:40:32
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/7707245518817c0416ef2fec0bad00d11c2afa56 [^]

fixes ISSUE-44892: on DB creation config scripts are applied in two steps

When creating database, the database model was created in two steps:

  1. model creation without taking into account config scripts
  2. config script changes (model and data) were applied

This can cause different problems.

Now the process is more like:

  1. read in memory model without config script changes
  2. read config script model changes and apply them in memory model
  3. create complete model in DB
  4. read and apply data in DB without config script changes
  5. read and apply in DB data config script changes

---
M src-db/database/lib/dbsourcemanager.jar
---