ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Qian" <daqiqi...@aol.com>
Subject iBATIS Cache
Date Wed, 29 Nov 2006 18:32:35 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<font size="2"><font face="Arial,sans-serif">All,<br>
I'm using&nbsp; following cache model in the project.<br>
&lt;cacheModel id="my-cache" type="MEMORY" readOnly="true"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;flushInterval hours="2" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;flushOnExecute statement="dummyQuery"/&gt;<br>
&nbsp; &lt;/cacheModel&gt;<br>
&lt;resultMap id="myResultMap" class="myClass" groupBy="Id" &gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result property="catIdList" resultMap="categoryMap"
&nbsp;&nbsp;&nbsp; &lt;result property="mediaList" resultMap="mediaMap" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result column="id" property="Id" jdbcType="INTEGER"
&nbsp;&nbsp;&nbsp; ...<br>
&lt;select id="Result" resultMap="myResultMap" cacheModel="my-cache"
myResultMap is a large object with two lists (list of objects) using
groupBy feature. My query joins (includes left join) several tables.
Query result is a list of myResultMap object. Here are a couple of
1) if all fields of an object on the list (catIdList or medialList) are
null (from left join), the object should not be on the list. But
groupBy doesn't exclude this kind of object. Also, groupBy doesn't
remove duplicate object on the list (</font></font><font size="2"  face="Arial,sans-serif"><font
face="Arial,sans-serif">catIdList or
medialList</font></font><font size="2"><font face="Arial,sans-serif">).<br>
2) it takes pretty long time (150-200 ms) to retrieve a large object
from the cache. I timed before and after "return queryForList("Result",
BTW, i'm using daoManager and code generated by Abator.<br>
I might do something wrong. Any suggestions will be appreciated.<br>

View raw message