ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Caching
Date Tue, 08 Feb 2005 21:50:14 GMT
I recall someone on my team having problems getting the cache working
too. We are using this: 

<cacheModels>
	<cacheModel id="siteUserCache" type="LRU" implementation="MEMORY"
readOnly="true">
		<flushInterval hours="12"/>
		<flushOnExecute statement="SiteUserInsert"/>
		<flushOnExecute statement="SiteUserUpdate"/>
		<flushOnExecute statement="SiteUserDelete"/>
		<!--
			<property name="size" value="1000" />
		-->
	</cacheModel>		
</cacheModels>

Perhaps you are missing the 'type' property.

Also make sure its turned on in your SqlMapConfig file:

<settings>
	<setting useStatementNamespaces="false"/>
	<setting cacheModelsEnabled="true"/>
</settings>

- Ron

--- Joe Chandler <joe.chandler@autodesk.com> wrote:

> Is caching implemented in the .NET version of iBatis.  I have tried
> several scenarious and it always looks to be going back to the
> database.
> I have resorted to cutting and pasting the cacheModels section from
> the
> iBatis examples and still it does not cache?
> 
>  
> 
> here is what I have:
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> 
>  
> 
> <sqlMap namespace="Request"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> 
>        xsi:noNamespaceSchemaLocation="SqlMap.xsd">
> 
>        
> 
>        
> 
>        <alias>
> 
>               <typeAlias alias="Reason" 
> 
>                     
> assembly="Autodesk.Consulting.MoveManager.Core.dll"
> 
> 
>  
> type="Autodesk.Consulting.MoveManager.Core.Data.ReasonLookup" />
> 
>        </alias>
> 
>        
> 
>        <cacheModels>
> 
>               <cacheModel id="ProductList-cache"
> implementation="MEMORY"
> >
> 
>                      <flushInterval hours="24"/>
> 
>                      <property name="Type" value="Weak"/>
> 
>               </cacheModel> 
> 
>     </cacheModels>   
> 
>        
> 
>        <resultMaps>                                           
> 
>               <resultMap id="ReasonResult" class="Reason">
> 
>                      <result property="Code" column="CODE"/>
> 
>                      <result property="Description"
> column="DESCRIPTION"/>
> 
>               </resultMap>
> 
>        </resultMaps>
> 
>        
> 
>        <!-- =============================================
> 
>         MAPPED STATEMENTS 
> 
>     ============================================= 
> 
>     -->
> 
>        <statements>
> 
>               <select id="getReasons" cacheModel="ProductList-cache"
> resultMap="ReasonResult" >               
> 
>                      SELECT 
> 
>                             InitCap(CODE) CODE, 
> 
>                             DESCRIPTION 
> 
>                      FROM 
> 
>                             RQST_REASON_FOR_MOVE_LUT
> 
>               </select>
> 
>        </statements>
> 
>        
> 
> </sqlMap>
> 
>  
> 
>  
> 
> What am I missing???
> 
>  
> 
> Thanks,
> 
>  
> 
> Joe
> 
>  
> 
> 


Mime
View raw message