Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0037852 | Openbravo ERP | 02. Master data management | public | 2018-02-07 13:49 | 2018-03-02 21:18 |
|
Reporter | gorkaion | |
Assigned To | markmm82 | |
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR18Q2 | |
Merge Request Status | |
Review Assigned To | dmiguelez |
OBNetwork customer | OBPS |
Web browser | |
Modules | Core |
Support ticket | 109 |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0037852: VariantChDescUpdateProcessor fails with OutOfMemoryError when there are many products to update /view.php?id=752#c600 |
Description | The process to update the characteristics description using the import entry fails if there are many products to update. |
Steps To Reproduce | 1 Go to Product Characteristics window.
2 If none exists create a Characteristic and a Value.
3 Click on Add to Product button.
4 Select all products and click done.
5 check that the process is slow, in some scenarios it even fails with a OutOfMemoryError. |
Proposed Solution | Several fixes that can be applied:
1. The VariantChDescUpdateProcessor does never clear the session. Do it after each product is updated:
process.update(productIds.getString(i), null);
OBDal.getInstance().flush();
OBDal.getInstance().getSession().clear();
2. ProductCharacteristicValueEventHandler creates an import entry with all the products. It could have some limit and one import entry for each 100 products. So if 600 products are updated then 6 import entries are created.
3. The VariantChDescUpdateProcess does refresh of each ProductCharacteristic and ProductCharacteristicValue. Is should be checked if these refreshes are really needed. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0037798 | | closed | markmm82 | Add Characteristic to Product does not update the Characteristic Description | related to | defect | 0049524 | | closed | igor_trebol | ProductCharacteristicValueEventHandler creates and hold a lock on 100 products |
|
Attached Files | issue37852.patch (1,878) 2018-02-07 14:00 https://issues.openbravo.com/file_download.php?file_id=11556&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2018-02-07 13:49 | gorkaion | New Issue | |
2018-02-07 13:49 | gorkaion | Assigned To | => Triage Finance |
2018-02-07 13:49 | gorkaion | OBNetwork customer | => Yes |
2018-02-07 13:49 | gorkaion | Modules | => Core |
2018-02-07 13:49 | gorkaion | Support ticket | => 109 |
2018-02-07 13:49 | gorkaion | Resolution time | => 1519772400 |
2018-02-07 13:49 | gorkaion | Triggers an Emergency Pack | => No |
2018-02-07 13:49 | gorkaion | Issue generated from | 0037798 |
2018-02-07 13:49 | gorkaion | Relationship added | related to 0037798 |
2018-02-07 14:00 | gorkaion | File Added: issue37852.patch | |
2018-02-07 14:35 | Practics | Issue Monitored: Practics | |
2018-02-07 14:59 | markmm82 | Status | new => scheduled |
2018-02-07 15:17 | markmm82 | Assigned To | Triage Finance => markmm82 |
2018-02-08 17:52 | markmm82 | Note Added: 0102276 | |
2018-02-15 16:38 | hgbot | Checkin | |
2018-02-15 16:38 | hgbot | Note Added: 0102440 | |
2018-02-15 16:38 | hgbot | Checkin | |
2018-02-15 16:38 | hgbot | Note Added: 0102441 | |
2018-02-15 16:39 | dmiguelez | Status | scheduled => resolved |
2018-02-15 16:39 | dmiguelez | Fixed in SCM revision | => https://code.openbravo.com/erp/devel/pi/rev/5c01854254bb6fe0bb0b5949d73ac73aa01131b8 [^] |
2018-02-15 16:39 | dmiguelez | Resolution | open => fixed |
2018-02-15 16:40 | dmiguelez | Review Assigned To | => dmiguelez |
2018-02-15 16:40 | dmiguelez | Note Added: 0102442 | |
2018-02-15 16:40 | dmiguelez | Status | resolved => closed |
2018-02-15 16:40 | dmiguelez | Fixed in Version | => 3.0PR18Q2 |
2018-02-15 16:42 | hgbot | Checkin | |
2018-02-15 16:42 | hgbot | Note Added: 0102443 | |
2018-02-15 17:23 | hgbot | Checkin | |
2018-02-15 17:23 | hgbot | Note Added: 0102446 | |
2018-02-16 12:08 | hgbot | Checkin | |
2018-02-16 12:08 | hgbot | Note Added: 0102458 | |
2018-02-22 12:48 | hgbot | Checkin | |
2018-02-22 12:48 | hgbot | Note Added: 0102594 | |
2018-02-22 12:48 | hgbot | Checkin | |
2018-02-22 12:48 | hgbot | Note Added: 0102595 | |
2018-02-22 18:19 | hudsonbot | Checkin | |
2018-02-22 18:19 | hudsonbot | Note Added: 0102767 | |
2018-02-22 18:19 | hudsonbot | Checkin | |
2018-02-22 18:19 | hudsonbot | Note Added: 0102768 | |
2018-02-22 18:19 | hudsonbot | Checkin | |
2018-02-22 18:19 | hudsonbot | Note Added: 0102769 | |
2018-02-22 18:19 | hudsonbot | Checkin | |
2018-02-22 18:19 | hudsonbot | Note Added: 0102773 | |
2018-03-02 21:18 | hudsonbot | Checkin | |
2018-03-02 21:18 | hudsonbot | Note Added: 0102944 | |
2022-06-15 16:40 | aferraz | Relationship added | related to 0049524 |
Notes |
|
|
Test Plan
1 Go to Product Characteristics window.
2 If none exists create a Characteristic and a Value.
3 Click on Add to Product button.
4 Select all products and click done.
5 check that the process goes fast and you don't get any failures. |
|
|
(0102440)
|
hgbot
|
2018-02-15 16:38
|
|
Repository: erp/devel/pi
Changeset: 5c01854254bb6fe0bb0b5949d73ac73aa01131b8
Author: Mark <markmm82 <at> gmail.com>
Date: Fri Feb 09 09:29:04 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/5c01854254bb6fe0bb0b5949d73ac73aa01131b8 [^]
Fix for issue 37852: VariantChDescUpdateProcessor fails with OutOfMemoryError
when there are many products to update
The process to update the characteristics description using the import entry was
failing if there are many products to update.
Here some reasons causing this issue:
1. The VariantChDescUpdateProcessor wasn't clearing the session.
2. ProductCharacteristicValueEventHandler creates an import entry with all the
products instead of having some limit.
3. The VariantChDescUpdateProcess was refreshing each ProductCharacteristic and
ProductCharacteristicValue. These refreshes aren't really needed.
As solution to this issue, were fixed the three points explained above:
1. The VariantChDescUpdateProcessor is clearing the session.
2. ProductCharacteristicValueEventHandler creates an import entry with a defined
limit (currently 100) of products instead of passing the entire product list.
3. Was removed refreshing of the objects.
---
M src/org/openbravo/event/ProductCharacteristicValueEventHandler.java
M src/org/openbravo/materialmgmt/VariantChDescUpdateProcess.java
M src/org/openbravo/materialmgmt/VariantChDescUpdateProcessor.java
---
|
|
|
(0102441)
|
hgbot
|
2018-02-15 16:38
|
|
Repository: erp/devel/pi
Changeset: 877547db1c2da0b3700ff32563b9f3c1ebb2f20a
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Feb 15 16:37:07 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/877547db1c2da0b3700ff32563b9f3c1ebb2f20a [^]
Related to Issue 37852. Code Review changes.
* Changed import entry size from 3 to 100
* Created productSubListIds as a JSONArray from the start instead of
converting it again
* Added logger and log error message
* Moved try-cacth to beginning-end of the block
---
M src/org/openbravo/event/ProductCharacteristicValueEventHandler.java
---
|
|
|
|
|
|
(0102443)
|
hgbot
|
2018-02-15 16:42
|
|
|
|
(0102446)
|
hgbot
|
2018-02-15 17:23
|
|
|
|
(0102458)
|
hgbot
|
2018-02-16 12:08
|
|
Repository: erp/devel/pi
Changeset: 3615cc2bb421b6b8a42b295569e6b470643856de
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Feb 16 12:08:35 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3615cc2bb421b6b8a42b295569e6b470643856de [^]
Related to Issue 37852. Removed wrong import of Log class and changed
variable to use the proper org.slf4j.Logger class
---
M src/org/openbravo/event/ProductCharacteristicValueEventHandler.java
---
|
|
|
(0102594)
|
hgbot
|
2018-02-22 12:48
|
|
|
|
(0102595)
|
hgbot
|
2018-02-22 12:48
|
|
Repository: erp/devel/pi
Changeset: e14339104a700718580afe3ce83f5bdfb9f5af49
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Feb 22 10:04:21 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e14339104a700718580afe3ce83f5bdfb9f5af49 [^]
Related to Issue 37852. Changed definition of Logger from protected
to private static
---
M src/org/openbravo/event/ProductCharacteristicValueEventHandler.java
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|