質問

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?

役に立ちましたか?

解決

(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 ...)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top