Can you give an example of what must be changed in hibernate.cfg.xml for caching
in hibernate.properties, I added:
in every hbm file, look up collection definitions and add
<cache usage="nonstrict-read-write"/> e.g. <list name="nodes" cascade="all"> <cache usage="nonstrict-read-write"/>
A few remarks:
hibernate.cache.use_second_level_cache is is enabled by default for classes which specify a mapping.
hibernate.cache.use_query_cache enables the query cache (individual queries still have to be set cachable). Do you use cachable queries?
The nonstrict-read-write strategy you use is probably not the best one for every collection. The other strategies are: read only, read/write, and transactional.
It was just a quick fix, just to see how things would improve. Of course, other settings must be examined. I guess use_query_cache is not needed, because from what I've seen from sourcecode, queries are not set to be cached (and maybe would be impractical in this situation).
I've included the use_second_level_cache to turn it on and off, for testing purposes. So indeed, the default is "on".