Now assume the #value# for my next query for the session is 11. What happens? Are items 11 and 12 retrieved from the cache? How would the cache implementation know to return these? Or does it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
caching is query and parameter based. So, if you have 2 queries that use the same sql statement and different parameters the cache will store the 2 sets of results seperately.
Brandon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Consider the following:
<cacheModel id="product-cache" implementation="LRU">
<flushInterval hours="24"/>
<property name="size" value="1000"/>
</cacheModel>
<statement id="getProductList" parameterClass="int" cacheModel="product-cache">
<![CDATA[
SELECT * FROM product
WHERE id > #value#
]]>
</statement>
Assume the #value# for my first query was 10 and it returned the following:
PRODUCT ID=10, DESC="Spring Framework Book"
PRODUCT ID=11, DESC="Oracle DB License"
PRODUCT ID=12, DESC="iPod 20GB"
Now assume the #value# for my next query for the session is 11. What happens? Are items 11 and 12 retrieved from the cache? How would the cache implementation know to return these? Or does it?
caching is query and parameter based. So, if you have 2 queries that use the same sql statement and different parameters the cache will store the 2 sets of results seperately.
Brandon