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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0009780
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2009-07-06 17:532009-07-27 00:00
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version2.50MP3
StatusclosedFix in branchFixed in SCM revisiond3aa261a64fc
ProjectionnoneETAnoneTarget Versionpi
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0009780: Module which add system level information (e.g. ad_ref_list) and add system reference data can not be (un)installed

DescriptionThis is a description based on the installation of the hcm module (attached). The general problem is that the apply.modules action when initiated from the web interface runs in the same jvm (classloader) as the webapp. I will first describe two specific things with this module:
1) it adds a new treetype and adds system level data which uses this tree type
2) it adds a column to a core table (BusinessPartnerBankAccount)

1) results in a fail during install, when trying to solve 1) --> 2) results in a fail during an uninstall.

>> Why does 1) fail
First the basic apply.modules process:
A) update.database
B) apply.module (incl. import of system level reference data)

After step A the database has the new model definition (with the new tree-type). However as the in-memory model is not refreshed step B fails as in step B the new tree type is used by imported System level data.

Initial solution idea (which does not work because then the uninstall fails): re-initialize the in-memory model after update.database

>> Why does 2) fail when we solve 1)
In this case the same steps A and B are executed. The module adds a column to BusinessPartnerBankAccount. So during an uninstall after step A, the column is removed from AD_COLUMN. To solve 1), after step A the in-memory model is refreshed. However, the generated classes still have this column, so during the re-initialization of the model the generated class (based on the old model before the uninstall) is encountered and it fails because it sets a default value for a column which does not exist.

Initial solution idea for this case: regenerate the entity classes after re-initializing the model. So then the steps would be:
A) update.database
B) re-initialize in-memory model
C) regenerate entity classes
D) apply.module

However, this flow does not work because the same jvm/classloader is used for all steps (and the webapp as a whole), so eventhough the class files are regenerated and compiled the jvm/classloader will still have the old classes in-memory.

So to really solve this the apply.module step in the install and uninstall of a module from the web interface should be running in its own jvm (forked).
Tags250MP3releasecandidate
Attached Files? file icon org.openbravo.hcm.common-1.0.0.obx [^] (221,192 bytes) 2009-07-06 17:53

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0009822 closedmtaal API check: build 69 fails 

-  Notes
(0017947)
hgbot (developer)
2009-07-06 23:27

Repository: erp/devel/pi
Changeset: d3aa261a64fc0882c8e4f2026ad707e2952ae9fc
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Jul 06 23:26:21 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d3aa261a64fc0882c8e4f2026ad707e2952ae9fc [^]

fixes issue 9780: Module which adds system level information (e.g. ad_ref_list) and add system reference data can not be (un)installed

---
M build.xml
M src/build.xml
M src/org/openbravo/erpCommon/modules/ApplyModuleTask.java
---
(0018063)
AinhoaPagola (reporter)
2009-07-09 16:43

I have tested the fix using HCM module and it is working fine. Thanks!
(0018623)
psarobe (manager)
2009-07-26 22:05

Thanks Ainhoa

- Issue History
Date Modified Username Field Change
2009-07-06 17:53 mtaal New Issue
2009-07-06 17:53 mtaal Assigned To => mtaal
2009-07-06 17:53 mtaal File Added: org.openbravo.hcm.common-1.0.0.obx
2009-07-06 23:27 hgbot Checkin
2009-07-06 23:27 hgbot Note Added: 0017947
2009-07-06 23:27 hgbot Status new => resolved
2009-07-06 23:27 hgbot Resolution open => fixed
2009-07-06 23:27 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d3aa261a64fc0882c8e4f2026ad707e2952ae9fc [^]
2009-07-09 16:43 AinhoaPagola Note Added: 0018063
2009-07-10 10:24 shuehner Relationship added related to 0009822
2009-07-21 16:24 psarobe Fixed in Version => 2.50MP3
2009-07-21 16:26 psarobe Tag Attached: 250MP3releasecandidate
2009-07-26 22:05 psarobe Status resolved => closed
2009-07-26 22:05 psarobe Note Added: 0018623
2009-07-27 00:00 anonymous sf_bug_id 0 => 2827493


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker