Can any one help me resolving this question. I am using Infinispan as second level cache and Hibernate as ORM. I have turned on both enityt and query cache.
I have two queries, for example Q1 is "selet b from BokkEntity b where b.id < 5" and another like Q2 is "select b from BokkEntity b where b.id < 7"
The first time I am running Q1 it loads 5 objects from persistent store into cache. running second query first time loads 7 objects in Cache. While first five objects are common in both query. And according to my understanding query Cache always just stores id and then if entity cache is on the search is done inside the cache for the objects, referenced by ids, in query cache.
So my Question is why both Q2 is loading all the objects again and overwriting these in entity cache while I run Q2(after running q1) first time.
I have checked query cache is working properly for any subsequent request. ie, if I rerun Q1 or Q2 the data is accessed from cache.
This is urgent, I will appreciate the effort.
Thanks
Meena