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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034499
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2016-11-14 17:062016-12-16 18:38
ReportercaristuView Statuspublic 
Assigned Tocaristu 
PriorityhighResolutionfixedFixed in Version3.0PR17Q1
StatusclosedFix in branchFixed in SCM revision48248d89f4ba
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

0034499: [clustering] CachedPreference feature is not supported on clustered environments

DescriptionThe 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 ReproduceIn description
Proposed SolutionTwo 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.
Tagsclustering
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0032039 closedcaristu Add generic mechanism to have multiple cached preferences 
related to defect 00302043.0PR15Q4 closedcaristu prevent unpaged datsource request from manual sources 
related to feature request 0032702 closedAugustoMauch Store server backoffice enablement 
related to feature request 00327283.0PR16Q3 closedinigosanchez Standard datasources should check entity access. 
related to feature request 00326103.0PR16Q3 closedNaroaIriarte standard datasources shouldn't accept where parameter by default 
related to defect 0034536 closedcaristu API change required to remove PreferenceEventHandler class 
blocks design defect 0034490 acknowledgedTriage Platform Base [clustering] Support clustering 
causes defect 0034514 closedcaristu [clustering] CachedPreference should implement Serializable 

-  Notes
(0091522)
hgbot (developer)
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 (developer)
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 (developer)
2016-11-15 16:47

Repository: erp/devel/pi
Changeset: 7ce6ca92bcbe89c1bd88c213b7e0dfa680160d9f
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Nov 15 16:45:52 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7ce6ca92bcbe89c1bd88c213b7e0dfa680160d9f [^]

related to issue 34499: updated comment

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/CachedPreference.java
---
(0091811)
alostale (manager)
2016-11-25 09:34

code reviewed + tested
(0092622)
hudsonbot (developer)
2016-12-16 18:38

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/dc8bf00badd0 [^]
Maturity status: Test
(0092631)
hudsonbot (developer)
2016-12-16 18:38

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/dc8bf00badd0 [^]
Maturity status: Test
(0092632)
hudsonbot (developer)
2016-12-16 18:38

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

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker