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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037852
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2018-02-07 13:492018-03-02 21:18
ReportergorkaionView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revision5c01854254bb
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037852: VariantChDescUpdateProcessor fails with OutOfMemoryError when there are many products to update /view.php?id=752#c600

DescriptionThe process to update the characteristics description using the import entry fails if there are many products to update.
Steps To Reproduce1 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 SolutionSeveral 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.
TagsNo tags attached.
Attached Filespatch file icon issue37852.patch [^] (1,878 bytes) 2018-02-07 14:00 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0037798 closedmarkmm82 Add Characteristic to Product does not update the Characteristic Description 
related to defect 0049524 closedigor_trebol ProductCharacteristicValueEventHandler creates and hold a lock on 100 products 

-  Notes
(0102276)
markmm82 (developer)
2018-02-08 17:52

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 (developer)
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 (developer)
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
---
(0102442)
dmiguelez (developer)
2018-02-15 16:40

Code Review + Testing Ok
(0102443)
hgbot (developer)
2018-02-15 16:42

Repository: erp/devel/pi
Changeset: c67f0ce334d34e604e37a3e11213149ea1c830b0
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Feb 15 16:42:01 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c67f0ce334d34e604e37a3e11213149ea1c830b0 [^]

Related to issue 37852. Changed Exception name to e

---
M src/org/openbravo/event/ProductCharacteristicValueEventHandler.java
---
(0102446)
hgbot (developer)
2018-02-15 17:23

Repository: erp/devel/api-checks
Changeset: ca59136ab09f99d9def5da14b587a0a2d4c8ac4b
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Feb 15 17:22:53 2018 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/ca59136ab09f99d9def5da14b587a0a2d4c8ac4b [^]

Related to Issue 37852: False API Change fix.

The logger has been changed to use org.slf4j.Logger
instead of import org.apache.log4j.Logger

---
M java/reference/java.japi.gz
---
(0102458)
hgbot (developer)
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 (developer)
2018-02-22 12:48

Repository: erp/devel/api-checks
Changeset: 12d876e8e3cfd97fcf74034d5744bfbb52315465
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Feb 22 12:47:41 2018 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/12d876e8e3cfd97fcf74034d5744bfbb52315465 [^]

Related to Issue 37852. API Change because Logger variable
has been moved from protected to private.

---
M java/reference/java.japi.gz
---
(0102595)
hgbot (developer)
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
---
(0102767)
hudsonbot (developer)
2018-02-22 18:19

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/980a6ad5bbf5 [^]
Maturity status: Test
(0102768)
hudsonbot (developer)
2018-02-22 18:19

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/980a6ad5bbf5 [^]
Maturity status: Test
(0102769)
hudsonbot (developer)
2018-02-22 18:19

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/980a6ad5bbf5 [^]
Maturity status: Test
(0102773)
hudsonbot (developer)
2018-02-22 18:19

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/980a6ad5bbf5 [^]
Maturity status: Test
(0102944)
hudsonbot (developer)
2018-03-02 21:18

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/05dece3dc80b [^]
Maturity status: Test

- 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 Modules => Core
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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker