Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029143Openbravo ERPA. Platformpublic2015-03-04 12:302015-04-01 08:31
alostale 
alostale 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR15Q1.23.0PR15Q1.2 
AugustoMauch
Core
No
0029143: 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
Approved
blocks defect 0029127 closed alostale PR14Q3 -> PR14Q4 update can fail activating FKs 
Issue History
2015-03-05 13:59alostaleTypedefect => backport
2015-03-05 13:59alostaleTarget Version => 3.0PR15Q1.2
2015-03-05 14:06alostaleReview Assigned To => AugustoMauch
2015-03-05 16:26dmitry_mezentsevTag Attached: Approved
2015-03-05 16:45hgbotCheckin
2015-03-05 16:45hgbotNote Added: 0075205
2015-03-05 16:45hgbotStatusscheduled => resolved
2015-03-05 16:45hgbotResolutionopen => fixed
2015-03-05 16:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q1.2/rev/79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3 [^]
2015-03-09 12:07AugustoMauchNote Added: 0075307
2015-03-09 12:07AugustoMauchStatusresolved => closed
2015-03-09 12:07AugustoMauchFixed in Version => 3.0PR15Q1.2
2015-04-01 08:05hgbotCheckin
2015-04-01 08:05hgbotNote Added: 0076198
2015-04-01 08:05hgbotStatusclosed => resolved
2015-04-01 08:05hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR15Q1.2/rev/79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3 [^] => http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3 [^]
2015-04-01 08:31priyamStatusresolved => closed
2015-04-01 08:31priyamNote Added: 0076275

Notes
(0075205)
hgbot   
2015-03-05 16:45   
Repository: erp/backports/3.0PR15Q1.2
Changeset: 79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 05 14:18:04 2015 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.2/rev/79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3 [^]

fixed bug 29143: 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
---
(0075307)
AugustoMauch   
2015-03-09 12:07   
Code reviewed and verified in [1]@79ff7ba47efb

[1] https://code.openbravo.com/erp/backports/3.0PR15Q1.2/ [^]
(0076198)
hgbot   
2015-04-01 08:05   
Repository: erp/backports/3.0PR15Q2
Changeset: 79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 05 14:18:04 2015 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/79ff7ba47efbc3c5f1f81d0ea77da9962f6593e3 [^]

fixed bug 29143: 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
---
(0076275)
priyam   
2015-04-01 08:31   
closed again, as the status changed due the merge tag of 3.0PR15Q1.2 to backports/3.0PR15Q2