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">
<html>
<head>
  <title></title>
</head>
<body>
<font size="2"><font face="Arial,sans-serif">All,<br>
<br>
I'm using&nbsp; following cache model in the project.<br>
<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>
<br>
&lt;resultMap id="myResultMap" class="myClass" groupBy="Id" &gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result property="catIdList" resultMap="categoryMap"
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result property="mediaList" resultMap="mediaMap" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result column="id" property="Id" jdbcType="INTEGER"
/&gt;<br>
&nbsp;&nbsp;&nbsp; ...<br>
&lt;/resultMap&gt;<br>
<br>
&lt;select id="Result" resultMap="myResultMap" cacheModel="my-cache"
&gt;<br>
...<br>
&lt;/select&gt;<br>
<br>
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
issues.<br>
<br>
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",
null)".<br>
<br>
BTW, i'm using daoManager and code generated by Abator.<br>
<br>
I might do something wrong. Any suggestions will be appreciated.<br>
<br>
Thanks,<br>
Tony<br>
<br>
</font></font>
</body>
</html>


Mime
View raw message