Why when I enable an Entity witth Hibernate 2L Cache with Ehcache concurrency.read_only and use_query_cache=false
, when I call findAll
for the first time, there are no misses, just PUTs:
...
INFO 9780 --- [e [_default_]-0] v.e.s.a.m.config.CacheEventLogger : Cache event CREATED for item with key com.managestudent.model.Province#70.
INFO 9780 --- [e [_default_]-0] v.e.s.a.m.config.CacheEventLogger : Cache event CREATED for item with key com.managestudent.model.Province#71.
INFO 9780 --- [ XNIO-1 task-2] i.StatisticalLoggingSessionEventListener : Session Metrics {
338100 nanoseconds spent acquiring 1 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
1387600 nanoseconds spent preparing 1 JDBC statements;
597100 nanoseconds spent executing 1 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
8808800 nanoseconds spent performing 71 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
159700 nanoseconds spent executing 1 partial-flushes (flushing a total of 0 entities and 0 collections)
}
.And on calls after, instead of HITs, the caches are updated:
INFO 9780 --- [e [_default_]-1] v.e.s.a.m.config.CacheEventLogger : Cache event UPDATED for item with key com.managestudent.model.Province#70.
INFO 9780 --- [e [_default_]-1] v.e.s.a.m.config.CacheEventLogger : Cache event UPDATED for item with key com.managestudent.model.Province#71.
INFO 9780 --- [ XNIO-1 task-2] i.StatisticalLoggingSessionEventListener : Session Metrics {
298200 nanoseconds spent acquiring 1 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
108200 nanoseconds spent preparing 1 JDBC statements;
736300 nanoseconds spent executing 1 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
3404100 nanoseconds spent performing 71 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
7000 nanoseconds spent executing 1 partial-flushes (flushing a total of 0 entities and 0 collections)
}