Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014073Openbravo ERPY. DBSourceManagerpublic2010-07-28 09:372010-08-18 00:00
marvintm 
marvintm 
urgentmajorhave not tried
closedfixed 
5
 
 
Core
No
0014073: DBSourceManager doesn't sort data changes properly before updating the database
DBSourceManager generates a list of data changes when doing update.database, and then tries to apply them by transforming each of them into a SQL statement (INSERT, DELETE, or UPDATE), and executing them one by one.

To ensure proper functioning of this process when UNIQUE constraints are activated, the changes need to be sorted first, and then executed in the proper order (DELETEs first, then UPDATES, and then INSERTS). However, this sorting doesn't happen.
Modify one row in the AD_COLUMN file, by changing its ID to a smaller value, and execute update.database. A UNIQUE constraint will fail.
The sorting needs to be done in update.database.
No tags attached.
Issue History
2010-07-28 09:37marvintmNew Issue
2010-07-28 09:37marvintmAssigned To => marvintm
2010-07-29 10:29hgbotCheckin
2010-07-29 10:29hgbotNote Added: 0029658
2010-07-29 10:29hgbotStatusnew => resolved
2010-07-29 10:29hgbotResolutionopen => fixed
2010-07-29 10:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/ff4425b09c4b70900a5646f39a6ae6d4b102b8a2 [^]
2010-07-29 10:33hgbotCheckin
2010-07-29 10:33hgbotNote Added: 0029659
2010-07-29 10:33hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/ff4425b09c4b70900a5646f39a6ae6d4b102b8a2 [^] => http://code.openbravo.com/erp/devel/pi/rev/32653bcd18376b2cce82b2af5be21d15cfc6ee10 [^]
2010-07-29 16:14hudsonbotCheckin
2010-07-29 16:14hudsonbotNote Added: 0029670
2010-08-17 18:09shuehnerNote Added: 0030084
2010-08-17 18:09shuehnerStatusresolved => closed
2010-08-18 00:00anonymoussf_bug_id0 => 3047307

Notes
(0029658)
hgbot   
2010-07-29 10:29   
Repository: erp/devel/dbsm-main
Changeset: ff4425b09c4b70900a5646f39a6ae6d4b102b8a2
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Jul 29 10:28:58 2010 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/ff4425b09c4b70900a5646f39a6ae6d4b102b8a2 [^]

Fixed issue 14073. Data changes will now be sorted before being applied.

---
M src/org/apache/ddlutils/alteration/DataComparator.java
---
(0029659)
hgbot   
2010-07-29 10:33   
Repository: erp/devel/pi
Changeset: 32653bcd18376b2cce82b2af5be21d15cfc6ee10
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Jul 29 10:29:47 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/32653bcd18376b2cce82b2af5be21d15cfc6ee10 [^]

Fixed issue 14073. Data changes will now be sorted before being applied.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0029670)
hudsonbot   
2010-07-29 16:14   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/32653bcd1837 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/9e1bb4f5ae0b [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17932.obx [^]
(0030084)
shuehner   
2010-08-17 18:09   
Tested on pi_pg, rev: e87917805d68.
Described use-case no works. Technical change did re-add two sorting calls which have been removed by some earlier commit by accident. -> Closing as fixed