Cache Overflow makes single select query call to DB.
EhCache.xml:
<cache name="Country1"
maxEntriesLocalHeap="200"
eternal="false"
overflowToDisk="false"
diskPersistent="false"
timeToLiveSeconds="800"
/>
Total Row count of table Country=229
.java file fires same simple SELECT query for 10times
1st query goes to DB and get cached.
2nd query checks cache and here in this case cache-limit reached(200),i.e. cache overflow happened ,
single select query fired per row(output attached).
Expected behaviour:
There should be some configuration to control the no. of queries / or it should fire the single query for non-cached elements.
Tried batch-size option but has limitation of only 1000 keys in 'IN' Clause
|