ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rao, Satish" <satish....@fmr.com>
Subject Cache not being flushed
Date Tue, 28 Jun 2005 16:34:10 GMT
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?




Mime
View raw message