Question

I use ehcache as second level cache and I want to use it to store simple text messages and locales (They are stored in the DB). But those messages will never change, so there is no need to refresh the data.

Should I set a new cache with no expiration? Should I use my existing cache?

Was it helpful?

Solution

(They are stored in the DB). But those messages will never change, so there is no need to refresh the data.

Why even use ehcache at all ? Just code it in Java without any database access. for constants like that I use an Enum or read from a property file, which is loaded postconstruction. You could even read it from database one time instead of a proeprty file.

(and I bet those messages will change eventually ...)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top