Notes |
|
(0118058)
|
hgbot
|
2020-02-24 17:23
|
|
Repository: erp/pmods/org.openbravo.service.external.integration
Changeset: 07d0b6dbdfed468985296bbbbf8e2b04028862f1
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Feb 24 17:15:45 2020 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration/rev/07d0b6dbdfed468985296bbbbf8e2b04028862f1 [^]
fixes BUG-43309: Memory leak in SBOImporterStore and SBOExporterStore
The SBOImporterStore was an @ApplicationScoped bean that centralizes the generation of SBOImporters. To handle this creation it used an injection point to retrieve dynamically the SBOImporter instances and the selecting one based on the Integration API type (ManualBOB or RetailAPI) of an specific EntityMapping.
The SBOImporters are @Dependent scoped, and this means that they are living as long as the bean instance they are injected in is living. As the SBOImporterStore is @ApplicationScoped the SBOImporters instances created with it were never being garbage collected which could eventually lead to OutOfMemory errors in some cases.
To fix this problem now the SBOImporterStore is not using the injection point and it instantiates manually the proper SBOImporter according to its Integration API type.
Note that this very same problem affected to the export flow and the same solution has been applied.
See here[1] for a detailed explanation of this problem.
Finally note that we have reduced the visibility of the class. The idea is to replace that manual implementation with a dynamic one but to implement it we need to update the module dependency with core so we can use the CDI.current() method available starting from the Weld upgrade[2].
[1] https://blog.akquinet.de/2017/01/04/dont-get-trapped-into-a-memory-leak-using-cdi-instance-injection/ [^]
[2] https://issues.openbravo.com/view.php?id=40193 [^]
---
M src/org/openbravo/service/external/integration/edl/BaseImportItemProcessor.java
M src/org/openbravo/service/external/integration/export/SynchronizableBusinessObjectExporter.java
M src/org/openbravo/service/external/integration/export/SynchronizableBusinessObjectExporterStore.java
M src/org/openbravo/service/external/integration/importer/DalSynchronizableBusinessObjectImporter.java
M src/org/openbravo/service/external/integration/importer/RetailApiSynchronizableBusinessObjectImporter.java
M src/org/openbravo/service/external/integration/importer/SynchronizableBusinessObjectImporter.java
M src/org/openbravo/service/external/integration/importer/SynchronizableBusinessObjectImporterStore.java
M src/org/openbravo/service/external/integration/mapping/EntityPropertyMapping.java
M src/org/openbravo/service/external/integration/mapping/JsonEntityPropertyMapping.java
---
|
|
|
(0118059)
|
hgbot
|
2020-02-24 17:24
|
|
Repository: erp/pmods/org.openbravo.service.external.integration.tests
Changeset: ea99a8f098d65b255c007672ad1f044b211b188c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Feb 24 17:20:39 2020 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration.tests/rev/ea99a8f098d65b255c007672ad1f044b211b188c [^]
related to BUG-43309: new way of getting instances of SBOImporters/SBOExporters
---
M src-test/org/openbravo/service/external/integration/test/_import/BaseImportTest.java
M src-test/org/openbravo/service/external/integration/test/export/CountryExportTest.java
M src-test/org/openbravo/service/external/integration/test/export/ExporterSetExternalIdentifierTest.java
---
|
|
|
(0118060)
|
hgbot
|
2020-02-24 17:24
|
|
|
|
(0118061)
|
hgbot
|
2020-02-24 17:24
|
|
|
|
(0118062)
|
hgbot
|
2020-02-24 17:27
|
|
|
|
(0118091)
|
hgbot
|
2020-02-25 11:52
|
|
|
|
(0118095)
|
hgbot
|
2020-02-25 14:05
|
|
|
|
|
Code reviewed and verified |
|