1000条才1M . 10000条10M 1000000条1G. 当然..几个字段肯定没有1K ..看来还是很可行的.. 但就是 全读到内存里面很费时间..
------解决方案-------------------- 关注一下
------解决方案-------------------- 在IBATIS里可以这样写 <cacheModel id="categoryCache" type="LRU"> <flushOnExecute statement="insert"/> <flushOnExecute statement="update"/> <flushOnExecute statement="delete"/> <property name="reference-type" value="WEAK"/> </cacheModel> <select id="getCategory" parameterClass="Category" resultClass="Category" cacheModel="categoryCache"> SELECT * FROM Category WHERE categoryId=#categoryId# </select> type MEMORY This model simply stores the cached data in memory until the garbage collector removes it. FIFO This is a fixed size model that uses a “first in, first out” algorithm to remove items from memory. LRU This is another fixed-size model that uses a “least recently used” algorithm to remove items from memory. OSCACHE This model uses the OpenSymphony (or OS) cache.