Add caching to database calls
Opened this issue · 3 comments
bjagg commented
Problem:
There is no caching for database calls. News Reader data is ideal with few updates and lots of reads.
Solution:
Add caching to HibernateNewsStore.java for the following:
- NewsConfiguration (x3)
- NewsSet
- NewsDefinition (x3)
There are several getters and the classes form a heirarchy: configuration > set > definition.
Some time will be needed to sort the caching strategy.
bjagg commented
Method review:
- storeNewsDefinition: all caches flushed
- storeNewsConfiguration: all caches flushed
- getNewsConfigurations: cache<subscribeId, list NewsConfiguration>
- getUserDefinedNewsConfiguration: cache<(setId,visibleOnly), list UserDefinedNewsConfiguration>
- getPredefinedNewsConfigurations: cache<(setId,visibleOnly), list PredefinedNewsConfiguration>
- getPredefinedNewsConfigurations: cache<(setId=-1,visibleOnly = false), list PredefinedNewsConfiguration>
- getHiddenPredefinedNewsDefinitions: cache<(setId, roles), list PredefinedNewsConfiguration>
- initNews: all caches flushed
- ...
bjagg commented
Also cache NEWS_PARAMETER table
bjagg commented
Spring dependencies already included.
Caching manager already defined: https://github.com/uPortal-Project/NewsReaderPortlet/blob/master/src/main/resources/context/applicationContext.xml#L40
Need to add cache annotation scan tag to application context still.