ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Harrison" <adrianharrison...@yahoo.co.uk>
Subject Force cache refresh?
Date Tue, 13 Dec 2005 14:34:13 GMT
I have a cached sql statement as follows - 

	<sqlMap namespace="PicklistCached">
		<cacheModel id="picklist-cache" type="MEMORY">
			<flushInterval hours="24"/>
			<property name="reference-type" value="STRONG"/>
		<resultMap id="lookupResult" class="lookup">
			<result property="lookupID" column="ID"/>
			<result property="lookupDescr" column="DESCR"/>
		<statement id="getCommentTypeList" resultMap="lookupResult"
			SELECT * FROM comment_type
			ORDER BY descr

This is called like so - 

	public class PicklistDao extends SqlMapDaoTemplate
	    public PicklistDao(DaoManager daoManager)

	    public List getCommentTypeList()
	        return executeQueryForList("getCommentTypeList", null);
	    protected List executeQueryForList(String statementName, Object
	        SqlMapExecutor sqlMap = getSqlMapExecutor();
	            return sqlMap.queryForList(statementName,
	        } catch (SQLException e)
	            throw new DaoException("Error executing query for list.
Cause: " + e, e);

A future requirement is that this table will need to be updated (but very
infrequently) - so I'll have something like - 

	<update id="updateCommentType" parameterClass="projectcomment">
		UPDATE comment_type SET
			descr = #descr#
			id = #id# 

is there a way to still use the cacheing & instruct ibatis to refresh the
cache after updateCommentType is called? 

Thanks in advance

(hope I've made some sense!)

Yahoo! Exclusive Xmas Game, help Santa with his celebrity party - http://santas-christmas-party.yahoo.net/

View raw message