ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: Ibatis Cache not flushing
Date Tue, 28 Jun 2005 17:06:59 GMT
Satish,

I am cc'ing the alias to get more help.

Nathan

On Jun 28, 2005, at 11:04 AM, Rao, Satish wrote:

> Hi Nathan,
>
> Thanks for the prompt reply.
>
> I already had caching turned on in the sqlmap config file. Here's  
> the file entry
>
> <sqlMapConfig>
> <settings
>   cacheModelsEnabled="true"
>   enhancementEnabled="false"
>   lazyLoadingEnabled="false"
>   maxRequests="32"
>   maxSessions="10"
>   maxTransactions="5"
>   useStatementNamespaces="false"
>   errorTracingEnabled="true"/>
>
>  <sqlMap resource="com/fmr/gift/strutsplus/dao/ibatis/Event.xml"/>
>  <sqlMap resource="com/fmr/gift/strutsplus/dao/ibatis/User.xml"/>
>  <sqlMap resource="com/fmr/gift/strutsplus/dao/ibatis/Stock.xml"/>
> </sqlMapConfig>
> -----Original Message--- --
> From: Nathan Maves [mailto:Nathan.Maves@Sun.COM]
> Sent: Tuesday, June 28, 2005 1:02 PM
> To: Rao, Satish
> Subject: Re: Ibatis Cache not flushing
>
> Everything looks good to me.
>
> Make sure that you have caching turn on in your sqlmap config file.
>
> <settings
>     cacheModelsEnabled="true"
>     enhancementEnabled="true"
>     maxSessions="64"
>     maxTransactions="8"
>     maxRequests="128"
>     useStatementNamespaces="false"/>
>
> Nathan
>
> On Jun 28, 2005, at 10:57 AM, Rao, Satish wrote:
>
>> Hi Nathan,
>>
>> I saw your message thread about cache not flushing http:// 
>> sourceforge.net/mailarchive/message.php?msg_id=9263689
>>
>> How did you resolve this? I am having the same issue.
>>
>> I have the following xml
>>
>> <sqlMap namespace="User">
>>         <cacheModel id="user-cache" type="LRU" readOnly="false"  
>> serialize="true">
>>                 <flushInterval hours="24"/>
>>                 <flushOnExecute statement="addUser"/>
>>                 <flushOnExecute statement="removeUser"/>
>>                 <flushOnExecute statement="addEmail"/>
>>                 <flushOnExecute statement="removeUserEmails"/>
>>                 <property name="cache-size" value="1000"/>
>>         </cacheModel>
>>         <resultMap id="list-users-result"  
>> class="com.fmr.gift.strutsplus.domain.User">
>>                 <result property="id" column="UID"/>
>>                 <result property="age" column="AGE"/>
>>                 <result property="firstname" column="FIRSTNAME"/>
>>                 <result property="lastname" column="LASTNAME"/>
>>                 <result property="eventsJoined" column="UID"  
>> select="getEventsJoinedByUserId"/>
>>                 <result property="emails" column="UID"  
>> select="getEmailsbyUserId"/>
>>         </resultMap>
>>         <select id="listUsers" resultMap="list-users-result"  
>> cacheModel="user-cache">
>>             SELECT
>>                 UID,
>>                 AGE,
>>                 FIRSTNAME,
>>                 LASTNAME
>>             FROM
>>                 USERS
>>         </select>
>>         <delete id="removeUser" parameterClass="java.lang.Long">
>>             DELETE FROM
>>                 USERS
>>             WHERE
>>                 UID = #value#
>>         </delete>
>> </sqlMap>
>>
>> The caching works fine for select. But when I delete a user, I  
>> expected the cache to be be flushed because of the following entry  
>> in cache model - <flushOnExecute statement="removeUser"/>. This  
>> does not happen. When I perform removeUser operation, the user  
>> list is displayed again and shows the user id that was deleted.
>>
>> Am I doing anything wrong here?
>>
>> Thanks,
>> Satish
>


Mime
View raw message