Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029127Openbravo ERPA. Platformpublic2015-03-04 12:302015-03-09 12:08
alostale 
alostale 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR15Q2 
AugustoMauch
Core
No
0029127: PR14Q3 -> PR14Q4 update can fail activating FKs
Updating Openbravo from PR14Q3 (or lower) to PR14Q4 (or higher) can result in a constraint not being possible to be activated.
-Install PR14Q3
-Open Costing Rules window
-Create a new Record
-Execute Validate Costing Rule process
-Update to PR14Q4
   -> This error appears:

     [java] 87780 WARN - SQL Command failed with: ERROR: insert or update on table "ad_process_run" violates foreign key constraint "ad_process_run_ad_process_requ"
     [java] Detail: Key (ad_process_request_id)=(A4A686C15C074C80982C31D6943F46AB) is not present in table "ad_process_request".
     [java] 87785 WARN - -- END
     [java] ALTER TABLE AD_PROCESS_RUN
     [java] ADD CONSTRAINT AD_PROCESS_RUN_AD_PROCESS_REQU FOREIGN KEY (AD_PROCESS_REQUEST_ID) REFERENCES AD_PROCESS_REQUEST (AD_PROCESS_REQUEST_ID) ON DELETE CASCADE
No tags attached.
related to defect 0028423 closed umartirena API Break on Cost Adjustments Project (try-api 985) 
related to feature request 0029154 closed alostale log table recreation on update database 
depends on backport 00291433.0PR15Q1.2 closed alostale PR14Q3 -> PR14Q4 update can fail activating FKs 
related to design defect 0029142 acknowledged Triage Platform Base update.database does not remove invalid rows with multiple level of cascaded FKs 
Issue History
2015-03-04 12:30alostaleNew Issue
2015-03-04 12:30alostaleAssigned To => AugustoMauch
2015-03-04 12:30alostaleModules => Core
2015-03-04 12:30alostaleTriggers an Emergency Pack => No
2015-03-05 13:11alostaleRelationship addedrelated to 0029142
2015-03-05 13:12alostaleStatusnew => scheduled
2015-03-05 13:12alostaleAssigned ToAugustoMauch => alostale
2015-03-05 13:14alostaleRelationship addedrelated to 0028423
2015-03-05 13:58alostaleStatusscheduled => acknowledged
2015-03-05 13:59alostaleStatusacknowledged => scheduled
2015-03-05 14:06alostaleReview Assigned To => AugustoMauch
2015-03-05 16:16hgbotCheckin
2015-03-05 16:16hgbotNote Added: 0075204
2015-03-05 16:16hgbotStatusscheduled => resolved
2015-03-05 16:16hgbotResolutionopen => fixed
2015-03-05 16:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9a12a6271cddeb57512e8b7a4014f53626f9dd35 [^]
2015-03-06 07:22alostaleRelationship addedrelated to 0029154
2015-03-06 16:04hudsonbotCheckin
2015-03-06 16:04hudsonbotNote Added: 0075255
2015-03-09 12:08AugustoMauchNote Added: 0075308
2015-03-09 12:08AugustoMauchStatusresolved => closed
2015-03-09 12:08AugustoMauchFixed in Version => 3.0PR15Q2

Notes
(0075204)
hgbot   
2015-03-05 16:16   
Repository: erp/devel/pi
Changeset: 9a12a6271cddeb57512e8b7a4014f53626f9dd35
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 05 14:18:04 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9a12a6271cddeb57512e8b7a4014f53626f9dd35 [^]

fixed bug 29127: PR14Q3 -> PR14Q4 update can fail activating FKs

  Added build validation to prevent this error.

  This build validation prevents issue 0029127 by deleting rows in ad_process_run for executions of
  CostingRuleProcess which is removed but due to issue 0029142 update database process is not able
  to properly handle.

  It is a temporary workaround and it should be removed one 0029142 is resolved.

  It should have been implemented as ModuleScript because it is repairing data, but because
  ad_process_run and ad_process_request tables are recreated when updating from PR14Q3 to PR14Q4,
  module script would be executed without indexes nor DB statistics which might result, depending
  on the data volumes in these table, in slow executions due to poor query execution plans.
  Exceptionally, implementing it as build validation to be executed before actual database update
  allowing better plans.

---
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/RemoveCostingRuleProcessExecutions.class
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/RemoveCostingRuleProcessExecutionsData.class
A src-util/buildvalidation/src/org/openbravo/buildvalidation/RemoveCostingRuleProcessExecutions.java
A src-util/buildvalidation/src/org/openbravo/buildvalidation/RemoveCostingRuleProcessExecutions_data.xsql
---
(0075255)
hudsonbot   
2015-03-06 16:04   
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/1601137b3c3d [^]
Maturity status: Test
(0075308)
AugustoMauch   
2015-03-09 12:08   
Code reviewed and verified in pi@b9fc7e8e60ae