Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040066Openbravo ERPA. Platformpublic2019-01-30 12:572019-02-01 10:12
caristu 
caristu 
highminorhave not tried
closedno change required 
5
 
 
caristu
Core
No
0040066: API Change: EntityPersistenceEventObserver declared as an @ApplicationScoped bean
The fix for issue 0040046 declares the EntityPersistenceEventObserver class as an @ApplicationScoped bean. This is done because having no annotation, classes extending this one are @Dependent by default, which means than on every write operation done with DAL (save, update, delete) a new instance of every EntityPersistenceEventObserver listening to any of those operations is created.

This is an API change because by default now there only will be one instance of every class extending EntityPersistenceEventObserver (unless the scope would be overridden in the subclass).

Besides, after this API change, event handlers should be proxyable objects for WELD by default. Proxyable classes are those classes which are not final and does not contain any final methods.

For this reason, if an @ApplicationScoped event handler is defined as final or with a final method, the following exception will be thrown on server startup: "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"

Note that it is still possible to define event handlers as Dependent by explicitly using the @Dependent annotation. In that case it is not required to define the event handler as a proxyable class.
N/A
Approved
related to defect 0040046 closed caristu unnecessary objects are created every time any DAL object is created/updated/deleted 
Issue History
2019-01-30 12:57caristuNew Issue
2019-01-30 12:57caristuAssigned To => caristu
2019-01-30 12:57caristuModules => Core
2019-01-30 12:57caristuTriggers an Emergency Pack => No
2019-01-30 12:57caristuIssue generated from0040046
2019-01-30 12:57caristuRelationship addedrelated to 0040046
2019-01-30 14:04alostaleTag Attached: Approved
2019-02-01 09:57caristuDescription Updatedbug_revision_view_page.php?rev_id=18253#r18253
2019-02-01 09:58caristuDescription Updatedbug_revision_view_page.php?rev_id=18254#r18254
2019-02-01 10:01caristuDescription Updatedbug_revision_view_page.php?rev_id=18255#r18255
2019-02-01 10:09caristuStatusnew => scheduled
2019-02-01 10:12caristuReview Assigned To => caristu
2019-02-01 10:12caristuNote Added: 0109414
2019-02-01 10:12caristuStatusscheduled => closed
2019-02-01 10:12caristuResolutionopen => no change required
2019-02-01 10:12caristuNote Edited: 0109414bug_revision_view_page.php?bugnote_id=0109414#r18257

Notes
(0109414)
caristu   
2019-02-01 10:12   
Functional/Behavior change. No additional changes in the API definition are required.