Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0041149 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] Y. DBSourceManager | major | have not tried | 2019-06-21 12:03 | 2019-06-26 04:55 | |||
Reporter | javietxe | View Status | public | |||||
Assigned To | AugustoMauch | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR19Q3 | |||
Status | closed | Fix in branch | Fixed in SCM revision | f455e5388bd2 | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | 3.0PR19Q1.1 | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | caristu | |||||||
OBNetwork customer | Gold | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0041149: It is not possible to delete a module if an alert rule references one of its tabs | |||||||
Description | When deleting a module that has a tab referenced by an alert rule, the following error is shown in the console (if the alert rule has produced any alerts) Example: [java] 33423 [main] ERROR org.apache.ddlutils.DatabaseOperationException - Error while executing SQL [java] org.postgresql.util.PSQLException: ERROR: update or delete on table "ad_alertrule" violates foreign key constraint "ad_alert_ad_alertrule" on table "ad_alert" [java] Detail: Key (ad_alertrule_id)=(035B3FEA7F244F0E8D85F25CB5FF5C5E) is still referenced from table "ad_alert". | |||||||
Steps To Reproduce | - Install the attached module (copy it into modules, run ant ant smartbuild -Dlocal=no). It will include a module with a tab - Execute the attached sql script. It will insert an alert rule that references the tab of the module, and an alert for the new alert rule. - Remove the new module from the modules/ folder and compile again. The update.database process will fail because, the alert rule is removed, the alert that references it is not. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() ![]() | |||||||
![]() |
||||||||
|
![]() |
|
(0112984) hgbot (developer) 2019-06-24 17:33 |
Repository: erp/devel/pi Changeset: f455e5388bd2f2558524d973251e84898dafb7a9 Author: Augusto Mauch <augusto.mauch <at> openbravo.com> Date: Mon Jun 24 17:32:34 2019 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/f455e5388bd2f2558524d973251e84898dafb7a9 [^] Fixes issue 41149: Alerts are deleted on cascade when deleting alert rules The update.database process was deleting entries from ad_alertrule when a tab referenced by them, but because if a missing on delete cascade, the entries from ad_alert that referenced them were not deleted, resulting in a data consistency exception. --- M src-db/database/model/tables/AD_ALERT.xml --- |
(0112987) shuehner (administrator) 2019-06-24 17:56 |
Possible simpler reproducer: what about just the module shipping an alertrule without the ad_tab connection. Just uninstalling that module owning the rule could maybe run into the same behavior. |
(0112999) caristu (viewer) 2019-06-25 10:23 |
Reviewed + tested OK. |
(0113018) hudsonbot (viewer) 2019-06-26 04:55 |
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/0c724fa9726e [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2019-06-21 12:03 | javietxe | New Issue | |
2019-06-21 12:03 | javietxe | Assigned To | => platform |
2019-06-21 12:03 | javietxe | OBNetwork customer | => Gold |
2019-06-21 12:03 | javietxe | Modules | => Core |
2019-06-21 12:03 | javietxe | Triggers an Emergency Pack | => No |
2019-06-24 14:16 | javietxe | Resolution time | => 1562882400 |
2019-06-24 17:17 | AugustoMauch | File Added: issue41149.rar | |
2019-06-24 17:29 | AugustoMauch | Summary | Deleting a module that has referenced data, the update database fails => It is not possible to delete a module if an alert rule references one of its tabs |
2019-06-24 17:29 | AugustoMauch | Description Updated | View Revisions |
2019-06-24 17:29 | AugustoMauch | Steps to Reproduce Updated | View Revisions |
2019-06-24 17:29 | AugustoMauch | File Added: insertAlertRuleAndAlert.sql | |
2019-06-24 17:33 | hgbot | Checkin | |
2019-06-24 17:33 | hgbot | Note Added: 0112984 | |
2019-06-24 17:33 | hgbot | Status | new => resolved |
2019-06-24 17:33 | hgbot | Resolution | open => fixed |
2019-06-24 17:33 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/f455e5388bd2f2558524d973251e84898dafb7a9 [^] |
2019-06-24 17:55 | shuehner | Assigned To | platform => AugustoMauch |
2019-06-24 17:56 | shuehner | Note Added: 0112987 | |
2019-06-25 09:16 | caristu | Review Assigned To | => caristu |
2019-06-25 10:23 | AugustoMauch | Relationship added | causes 0041168 |
2019-06-25 10:23 | caristu | Note Added: 0112999 | |
2019-06-25 10:23 | caristu | Status | resolved => closed |
2019-06-25 10:23 | caristu | Fixed in Version | => 3.0PR19Q3 |
2019-06-26 04:55 | hudsonbot | Checkin | |
2019-06-26 04:55 | hudsonbot | Note Added: 0113018 |
Copyright © 2000 - 2009 MantisBT Group |