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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0040046
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2019-01-28 14:032019-03-28 14:55
ReportercaristuView Statuspublic 
Assigned Tocaristu 
PriorityhighResolutionfixedFixed in Version3.0PR19Q2
StatusclosedFix in branchFixed in SCM revision396b375afe22
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0040046: unnecessary objects are created every time any DAL object is created/updated/deleted

DescriptionEntityPersistenceEventObserver should be declared as an @ApplicationScoped bean, otherwise when a new event (save, update, delete, transaction begin, transaction completed) is fired a new instance of every EntityPersistenceEventObserver listening to that particular event is created.
Steps To Reproduce1) Apply the provided patch, which writes in the log every time a new instance of EntityPersistenceEventObserver is created.
2) Go to the [Sales Order]
3) Create a new record. Check in the log that a new instance of every EntityPersistenceEventObserver listening to the save event is created.
4) Create another record. Check in the log that a new instance of every EntityPersistenceEventObserver listening to the save event is created again.

Note that same happens for the rest of events.
Proposed SolutionSet EntityPersistenceEventObserver as @ApplicationScoped and review all classes extending EntityPersistenceEventObserver to ensure that this change is safe.
TagsPerformance
Attached Filesdiff file icon entityPersistenceEventObserver.diff [^] (1,098 bytes) 2019-01-28 14:04 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0030571 closedAugustoMauch Openbravo ERP It is not possible to remove a row if it contains a mandatory image 
related to defect 0040072 newTriage Omni WMS Modules TaskEventObserver should be defined as @ApplicationScoped 
related to defect 0040066 closedcaristu Openbravo ERP API Change: EntityPersistenceEventObserver declared as an @ApplicationScoped bean 
related to defect 0040067 closedcaristu Openbravo ERP Cleanup in EntityPersistenceEventObserver classes 

-  Notes
(0109328)
hgbot (developer)
2019-01-30 13:49

Repository: erp/devel/pi
Changeset: e74dadb5ea9bc8b31f9625d86473b91cdb61542c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jan 30 13:48:11 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e74dadb5ea9bc8b31f9625d86473b91cdb61542c [^]

related to issue 40046: make observer be stateless

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
---
(0109329)
hgbot (developer)
2019-01-30 13:52

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 26fa6e6dce880dfd4227590b86abd9419b92aab1
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jan 30 13:50:52 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/26fa6e6dce880dfd4227590b86abd9419b92aab1 [^]

related to issue 40046: make observer be stateless

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/ImportEntryNoSyncEventHandler.java
---
(0109330)
hgbot (developer)
2019-01-30 13:57

Repository: erp/pmods/org.openbravo.warehouse.advancedwarehouseoperations
Changeset: 40f8f26b154025a40f30aca8c7a6588dd6431739
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jan 30 13:55:53 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.advancedwarehouseoperations/rev/40f8f26b154025a40f30aca8c7a6588dd6431739 [^]

related to issue 40046: define observer as Dependent

  - Explicitly define the observer as @Dependent
  - Applied new java formatting

---
M src/org/openbravo/warehouse/advancedwarehouseoperations/eventobserver/TaskEventObserver.java
---
(0109339)
hgbot (developer)
2019-01-30 19:07

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 2d93921155ac5011d455f3d44ea27b043cf199df
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jan 30 19:03:22 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/2d93921155ac5011d455f3d44ea27b043cf199df [^]

related to issue 40046: remove final modifiers to avoid error on server startup

  Removed the final modifiers, now that the observers are @ApplicationScoped, the following error is raised on server startup in case they are final or if they have any final method: "org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class is not proxyable because the type is final or it contains a final method"

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/AutoRouteAndPushGenericEventHandler.java
---
(0109408)
hgbot (developer)
2019-02-01 09:49

Repository: erp/devel/pi
Changeset: 396b375afe225c3474e022655cd11040e73f2734
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Feb 01 08:48:40 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/396b375afe225c3474e022655cd11040e73f2734 [^]

fixes bug 40046: unnecessary objects created every time a DAL event is fired

  Declare EntityPersistenceEventObserver as @ApplicationScoped so that just one instance of every event handler is created by default. This is because being Dependent, a new instance of every event handler listening to a particular DAL event (save, update, delete, transaction begin, transaction completed) was being created.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/event/EntityPersistenceEventObserver.java
---
(0109671)
alostale (manager)
2019-02-11 14:39

reviewed
(0110761)
hudsonbot (developer)
2019-03-28 14:55

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/b2fbc1588df4 [^]
Maturity status: Test
(0110787)
hudsonbot (developer)
2019-03-28 14:55

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

- Issue History
Date Modified Username Field Change
2019-01-28 14:03 caristu New Issue
2019-01-28 14:03 caristu Assigned To => platform
2019-01-28 14:03 caristu Modules => Core
2019-01-28 14:03 caristu Triggers an Emergency Pack => No
2019-01-28 14:04 caristu File Added: entityPersistenceEventObserver.diff
2019-01-28 14:08 caristu Description Updated View Revisions
2019-01-28 14:08 caristu Steps to Reproduce Updated View Revisions
2019-01-28 14:08 caristu Assigned To platform => caristu
2019-01-28 14:08 caristu Proposed Solution updated
2019-01-28 16:11 caristu Summary EntityPersistenceEventObserver should be declared as application scoped => EntityPersistenceEventObserver should be declared as @ApplicationScoped
2019-01-28 16:11 caristu Description Updated View Revisions
2019-01-29 09:01 alostale Tag Attached: Performance
2019-01-29 09:03 alostale Summary EntityPersistenceEventObserver should be declared as @ApplicationScoped => unnecessary objects are created every time any DAL object is created/updated/deleted
2019-01-30 12:57 caristu Issue cloned 0040066
2019-01-30 12:57 caristu Relationship added related to 0040066
2019-01-30 13:02 caristu Issue cloned 0040067
2019-01-30 13:02 caristu Relationship added related to 0040067
2019-01-30 13:22 caristu Relationship added related to 0030571
2019-01-30 13:49 hgbot Checkin
2019-01-30 13:49 hgbot Note Added: 0109328
2019-01-30 13:52 hgbot Checkin
2019-01-30 13:52 hgbot Note Added: 0109329
2019-01-30 13:57 hgbot Checkin
2019-01-30 13:57 hgbot Note Added: 0109330
2019-01-30 14:05 caristu Relationship added related to 0040072
2019-01-30 19:07 hgbot Checkin
2019-01-30 19:07 hgbot Note Added: 0109339
2019-01-30 19:09 caristu Status new => scheduled
2019-02-01 09:49 hgbot Checkin
2019-02-01 09:49 hgbot Note Added: 0109408
2019-02-01 09:49 hgbot Status scheduled => resolved
2019-02-01 09:49 hgbot Resolution open => fixed
2019-02-01 09:49 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/396b375afe225c3474e022655cd11040e73f2734 [^]
2019-02-01 09:50 caristu Review Assigned To => alostale
2019-02-11 14:39 alostale Note Added: 0109671
2019-02-11 14:39 alostale Status resolved => closed
2019-02-11 14:39 alostale Fixed in Version => 3.0PR19Q2
2019-03-28 14:55 hudsonbot Checkin
2019-03-28 14:55 hudsonbot Note Added: 0110761
2019-03-28 14:55 hudsonbot Checkin
2019-03-28 14:55 hudsonbot Note Added: 0110787


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker