Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching to database calls #125

Open
bjagg opened this issue Oct 3, 2019 · 3 comments
Open

Add caching to database calls #125

bjagg opened this issue Oct 3, 2019 · 3 comments
Assignees
Labels

Comments

@bjagg
Copy link
Member

bjagg commented Oct 3, 2019

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 bjagg added the bug label Oct 3, 2019
@bjagg bjagg self-assigned this Oct 3, 2019
@bjagg
Copy link
Member Author

bjagg commented Oct 3, 2019

Method review:

  1. storeNewsDefinition: all caches flushed
  2. storeNewsConfiguration: all caches flushed
  3. getNewsConfigurations: cache<subscribeId, list NewsConfiguration>
  4. getUserDefinedNewsConfiguration: cache<(setId,visibleOnly), list UserDefinedNewsConfiguration>
  5. getPredefinedNewsConfigurations: cache<(setId,visibleOnly), list PredefinedNewsConfiguration>
  6. getPredefinedNewsConfigurations: cache<(setId=-1,visibleOnly = false), list PredefinedNewsConfiguration>
  7. getHiddenPredefinedNewsDefinitions: cache<(setId, roles), list PredefinedNewsConfiguration>
  8. initNews: all caches flushed
  9. ...

@bjagg
Copy link
Member Author

bjagg commented Jul 13, 2021

Also cache NEWS_PARAMETER table

@bjagg
Copy link
Member Author

bjagg commented Feb 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant