Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0034499 | Openbravo ERP | A. Platform | public | 2016-11-14 17:06 | 2016-12-16 18:38 |
|
Reporter | caristu | |
Assigned To | caristu | |
Priority | high | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR17Q1 | |
Merge Request Status | |
Review Assigned To | alostale |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0034499: [clustering] CachedPreference feature is not supported on clustered environments |
Description | The CachedPreference class is an application scoped which implements a cache that keeps in memory the value of some preferences defined at system level along the application life cycle, avoiding the time spent to compute the preference value.
This cache is invalidated/updated by using an observer called PreferenceEventHandler. This kind of cache invalidation is not valid for clustered environments (multiple JVM)
Currently, it will be necessary to restart Tomcat to retrieve the new value of the preference in every JVM. |
Steps To Reproduce | In description |
Proposed Solution | Two possible alternatives:
a) Declare CachedPreference as @SessionScoped. This way the cache will be recreated on every new session. This is even more appropriate for the case of preferences as they are being refreshed on every new session. This is the recommended solution for this case.
b) Implement a invalidation mechanism valid for a clustered environment. For example based on a timer: by invalidating the cache every time the timeout is expired. |
Additional Information | |
Tags | clustering |
Relationships | related to | feature request | 0032039 | | closed | caristu | Add generic mechanism to have multiple cached preferences | related to | defect | 0030204 | 3.0PR15Q4 | closed | caristu | prevent unpaged datsource request from manual sources | related to | feature request | 0032702 | | closed | AugustoMauch | Store server backoffice enablement | related to | feature request | 0032728 | 3.0PR16Q3 | closed | inigosanchez | Standard datasources should check entity access. | related to | feature request | 0032610 | 3.0PR16Q3 | closed | NaroaIriarte | standard datasources shouldn't accept where parameter by default | related to | defect | 0034536 | | closed | caristu | API change required to remove PreferenceEventHandler class | blocks | design defect | 0034490 | | acknowledged | Triage Platform Base | [clustering] Support clustering | causes | defect | 0034514 | | closed | caristu | [clustering] CachedPreference should implement Serializable |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2016-11-14 17:06 | caristu | New Issue | |
2016-11-14 17:06 | caristu | Assigned To | => platform |
2016-11-14 17:06 | caristu | Modules | => Core |
2016-11-14 17:06 | caristu | Triggers an Emergency Pack | => No |
2016-11-14 17:06 | caristu | Relationship added | blocks 0034490 |
2016-11-14 17:07 | caristu | Relationship added | related to 0032039 |
2016-11-14 17:07 | caristu | Relationship added | related to 0030204 |
2016-11-14 17:09 | caristu | Relationship added | related to 0032702 |
2016-11-14 17:10 | caristu | Relationship added | related to 0032728 |
2016-11-14 17:18 | caristu | Relationship added | related to 0032610 |
2016-11-14 17:19 | caristu | Proposed Solution updated | |
2016-11-14 19:15 | caristu | Assigned To | platform => caristu |
2016-11-14 19:15 | caristu | Status | new => scheduled |
2016-11-15 08:37 | hgbot | Checkin | |
2016-11-15 08:37 | hgbot | Note Added: 0091522 | |
2016-11-15 08:37 | hgbot | Status | scheduled => resolved |
2016-11-15 08:37 | hgbot | Resolution | open => fixed |
2016-11-15 08:37 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/48248d89f4bae13423869c9969342943c7f97b1f [^] |
2016-11-15 08:38 | caristu | Review Assigned To | => alostale |
2016-11-15 08:59 | alostale | Tag Attached: clustering | |
2016-11-15 09:37 | caristu | Relationship added | causes 0034514 |
2016-11-15 16:25 | caristu | Relationship added | related to 0034536 |
2016-11-15 16:47 | hgbot | Checkin | |
2016-11-15 16:47 | hgbot | Note Added: 0091575 | |
2016-11-15 16:47 | hgbot | Checkin | |
2016-11-15 16:47 | hgbot | Note Added: 0091576 | |
2016-11-25 09:34 | alostale | Note Added: 0091811 | |
2016-11-25 09:34 | alostale | Status | resolved => closed |
2016-11-25 09:34 | alostale | Fixed in Version | => 3.0PR17Q1 |
2016-12-16 18:38 | hudsonbot | Checkin | |
2016-12-16 18:38 | hudsonbot | Note Added: 0092622 | |
2016-12-16 18:38 | hudsonbot | Checkin | |
2016-12-16 18:38 | hudsonbot | Note Added: 0092631 | |
2016-12-16 18:38 | hudsonbot | Checkin | |
2016-12-16 18:38 | hudsonbot | Note Added: 0092632 | |
Notes |
|
(0091522)
|
hgbot
|
2016-11-15 08:37
|
|
Repository: erp/devel/pi
Changeset: 48248d89f4bae13423869c9969342943c7f97b1f
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Nov 15 08:36:29 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/48248d89f4bae13423869c9969342943c7f97b1f [^]
fixes issue 34499: CachedPreference feature does not support clustering
The CachedPreference was being used as a singleton which was keeping a set of preferences defined at System Level in a cache. Those values can be refreshed with the PreferenceEventHandler every time it detects a change. This mechanism was not valid for clustered environments because changes were being detected just on the node (JVM) where the event handler was executed.
To fix this problem we have modified the scope of the class from application to session. Thus, the cache will be initialized on every new session created on each node of the cluster.
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/CachedPreference.java
---
|
|
|
(0091575)
|
hgbot
|
2016-11-15 16:47
|
|
Repository: erp/devel/pi
Changeset: 9d2a3ac397418df563ba20c90766b20e9e6635a1
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Nov 15 16:45:28 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9d2a3ac397418df563ba20c90766b20e9e6635a1 [^]
related to issue 34499: removed PreferenceEventHandler class
PreferenceEventHandler class was being used to detect changes on the preference values cached by the CachedPreference class. As CachedPreference now declared the @SessionScoped is no longer a singleton therefore the cached values will persist along the life cycle of a session.
As preferences are refreshed with every new session this handler is no longer required. Besides, the injection of the @SessionScoped bean in this handler was causing WELD-001303 error.
---
R modules/org.openbravo.client.application/src/org/openbravo/client/application/event/PreferenceEventHandler.java
---
|
|
|
(0091576)
|
hgbot
|
2016-11-15 16:47
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|