The advantage of a real second-level cache over a static map is that you get the advantage of in-memory access by still keeping the same way of defining, accessing and traversing your entities: by using the bernate session (or entity manager).
The advantage of a real second-level cache over a static map is that you get the advantage of in-memory access by still keeping the same way of defining, accessing and traversing your entities: by using the bernate session (or entity manager). You may keep relationships with other entities (even not cached); you may use a query cache and still perform queries over these entities (and results of these queries will be cached as well). In short, it's transparent, offers more options as Bozho said, and is much easier to use because cached entties are used the same way as other entities.
– Novice Coder May 25 at 8:56 Executing a HQL query loading all the entities should do the trick : select c from CachedEntity c. – JB Nizet May 25 at 9:35.
Ehcache has a lot more features than a Map: limit the maximum number of elements in memory overflow to disk (if the above number is exceeded) set a time-to-live and time-to-idle for elements allows replication within a cluster If you don't need any of those, you can safely use a Map - it will be easier to configure.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.