Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0041149
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajorhave not tried2019-06-21 12:032019-06-26 04:55
ReporterjavietxeView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR19Q3
StatusclosedFix in branchFixed in SCM revisionf455e5388bd2
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0PR19Q1.1SCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0041149: It is not possible to delete a module if an alert rule references one of its tabs

DescriptionWhen 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.
TagsNo tags attached.
Attached Filesrar file icon issue41149.rar [^] (4,166 bytes) 2019-06-24 17:17
? file icon insertAlertRuleAndAlert.sql [^] (517 bytes) 2019-06-24 17:29

- Relationships Relation Graph ] Dependency Graph ]
causes defect 0041168 closedAugustoMauch API Change: on delete cascade added to ad_alert.ad_alertrule_id foreign key 

-  Notes
(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 (developer)
2019-06-25 10:23

Reviewed + tested OK.
(0113018)
hudsonbot (developer)
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

- Issue History
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 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
Powered by Mantis Bugtracker