ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Bennett <mark.bennett.m...@gmail.com>
Subject Re: Caching - The same cacheModel with similar queries
Date Wed, 20 Apr 2005 12:43:52 GMT
Woudn't it be better to use the <isNotNull> tag to wrap your where 
statement? The cache should keep each queries results seperate since null 
will hash differently than any value passed in.
 Mark

 On 4/18/05, Guido García Bernardo <ggarciab@itdeusto.com> wrote: 
> 
> Hi,
> I've two questions regarding with caching.
> Is caching useful when using two similar queries (the second one being
> the first one plus a where clause) ?
> 
> <statement id="getAreas" resultMap="area_result"
> cacheModel="areas-cache">
> select * from AREAS
> </statement>
> 
> <statement id="getArea" resultMap="area_result"
> cacheModel="areas-cache">
> select * from AREAS where codigo = #value#
> </statement>
> 
> <cacheModel id="areas-cache" readOnly="true" type="MEMORY">
> <flushInterval hours="24" />
> <property name="reference-type" value="WEAK" />
> </cacheModel>
> 
> Is there any problem when using WEAK references?
> (
> http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg01190.html
> )
> 
> Thank you.
> Guido García Bernardo.
>

Mime
View raw message