Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020591Openbravo ERPY. DBSourceManagerpublic2012-05-23 15:192012-05-30 18:13
marvintm 
marvintm 
urgentmajorhave not tried
closedfixed 
5
 
3.0MP12 
Core
No
0020591: update.database should not destroy data if a problem happens when recreating a table
Currently, if a problem happens when dbsourcemanager has to recreate a table, the process will delete the original table, and its data will be lost.

This should be clearly avoided.
- Modify a column of a table in the XML, and set it to an illegal value (for example, set the length of a varchar column to a value which is smaller than the data currently in the database).
- Do update.database. Verify that errors appear, but the process continues, and that after it has finished, the table has been deleted, along with its data.
The process should stop in that case, and a message explaining the problem should be shown.
No tags attached.
Issue History
2012-05-23 15:19marvintmNew Issue
2012-05-23 15:19marvintmAssigned To => marvintm
2012-05-23 15:19marvintmModules => Core
2012-05-28 15:44hgbotCheckin
2012-05-28 15:44hgbotNote Added: 0049371
2012-05-28 15:44hgbotStatusnew => resolved
2012-05-28 15:44hgbotResolutionopen => fixed
2012-05-28 15:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/a6a6f4d9ea32ffea2a7301351660730781cac4c9 [^]
2012-05-28 17:54hgbotCheckin
2012-05-28 17:54hgbotNote Added: 0049379
2012-05-28 17:54hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/a6a6f4d9ea32ffea2a7301351660730781cac4c9 [^] => http://code.openbravo.com/erp/devel/pi/rev/2f1eca1d8609f493276b969c2733b49463fbc705 [^]
2012-05-29 12:00hgbotCheckin
2012-05-29 12:00hgbotNote Added: 0049417
2012-05-29 12:01hgbotCheckin
2012-05-29 12:01hgbotNote Added: 0049418
2012-05-29 12:09AugustoMauchNote Added: 0049420
2012-05-29 12:09AugustoMauchStatusresolved => closed
2012-05-29 12:09AugustoMauchFixed in Version => 3.0MP12
2012-05-30 18:13hudsonbotCheckin
2012-05-30 18:13hudsonbotNote Added: 0049497
2012-05-30 18:13hudsonbotCheckin
2012-05-30 18:13hudsonbotNote Added: 0049506

Notes
(0049371)
hgbot   
2012-05-28 15:44   
Repository: erp/devel/dbsm-main
Changeset: a6a6f4d9ea32ffea2a7301351660730781cac4c9
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon May 28 15:44:10 2012 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/a6a6f4d9ea32ffea2a7301351660730781cac4c9 [^]

Fixed issue 20591. Fixed issue 20592. Several changes have been made:
- The table creation commands are now considered 'critical'. This means that the process will fail automatically, with an specific message, if one of these commands fails.
- The create fks and triggers methods now return whether there were errors or not during the execution.
- This new boolean is now used by update.database to make the process fail in the end, if some trigger or foreign key was not correctly enabled. This failure is a normal exception which will be detected by the rebuild window as an error in the process.
- Additionally (and unrelated to these issues actually) a new convenient method to load a basic database model which includes only tables has been included.

---
M src/org/apache/ddlutils/Platform.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Platform.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0049379)
hgbot   
2012-05-28 17:54   
Repository: erp/devel/pi
Changeset: 2f1eca1d8609f493276b969c2733b49463fbc705
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon May 28 17:31:44 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2f1eca1d8609f493276b969c2733b49463fbc705 [^]

Fixed issue 20591. Fixed issue 20592. Several changes have been made:
> - The table creation commands are now considered 'critical'. This means that the process will fail automatically, with an specific message, if one of these commands fails.
> - The create fks and triggers methods now return whether there were errors or not during the execution.
> - This new boolean is now used by update.database to make the process fail in the end, if some trigger or foreign key was not correctly enabled. This failure is a normal exception which will be detected by the rebuild window as an error in the process.
> - Additionally (and unrelated to these issues actually) a new convenient method to load a basic database model which includes only tables has been included.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0049417)
hgbot   
2012-05-29 12:00   
Repository: erp/devel/dbsm-main
Changeset: 23f448913ec6acca0df106ac501d3ceb85faedf6
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue May 29 12:00:20 2012 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/23f448913ec6acca0df106ac501d3ceb85faedf6 [^]

Related to issue 20591. Further clarified the message shown when a critical error happens

---
M src/org/apache/ddlutils/platform/PlatformImplBase.java
---
(0049418)
hgbot   
2012-05-29 12:01   
Repository: erp/devel/pi
Changeset: 5e3ad075603e5f530868eafeaa71f2076fcaca15
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue May 29 12:00:37 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5e3ad075603e5f530868eafeaa71f2076fcaca15 [^]

Related to issue 20591. Further clarified the message shown when a critical error happens

---
M src-db/database/lib/dbsourcemanager.jar
---
(0049420)
AugustoMauch   
2012-05-29 12:09   
Code reviewed and verified in pi@5e3ad075603e
(0049497)
hudsonbot   
2012-05-30 18:13   
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/3752a665362c [^]

Maturity status: Test
(0049506)
hudsonbot   
2012-05-30 18:13   
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/3752a665362c [^]

Maturity status: Test