Reputation: 2036
I need to load some data from DB to Cache on server start up.And once a request came, need to take the data from this cache.Also need to refresh cache in frequent intervals.It would be help if somebody provide way for achieving this.I am using Spring 3.1. Thanks
Upvotes: 2
Views: 3053
Reputation: 11715
There are lots of cache implementations available:
LoadingCache
ConcurrentHashMap
from the JDK if you don't want more dependenciesUpvotes: 4
Reputation: 5193
Try Infinispan.
It modern, open source and easy to use cache. You can embed it and use directly, or use it as second level cache in hibernate.
Upvotes: 1
Reputation: 2378
I think this is what you are looking for:
As you will see my recommendation is to use hibernate second level cache and your problem will be fixed at configuration level.
Upvotes: 1