You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Jatan Porecha <po...@gmail.com> on 2009/03/20 23:36:23 UTC

Cache does not flush when mappings are loaded through SqlMapClientFactoryBean

When I configure *iBATIS* sql maps to get loaded through
SqlMapClientFactoryBean the chache models are not loaded properly.

I have confiugred my *iBATIS* SQL Map config and sql map files as following,

<bean id="sqlMap"
class="org.springframework.orm.ibatis.SqlMapClient FactoryBean">
<property name="configLocation">
<value>classpath:SqlMapConfig.xml</value>
</property>
<property name="mappingLocations"
value="classpath:com/app/business/sqlmaps/*SQLMap.xml" />
<property name="dataSource" ref="dataSource" />
</bean>

I tried debugging *iBATIS* code and ultimately found out that whenever the
mappings are loaded through SqlMapClientFactoryBean, *iBATIS*'s
wireUpCacheModel is called before the actual cacheModels are built.
Therefore the cache does not get flushed on the specified statements.
However if I load SQL map files through Sql Map config file everything works
fine !

Regards,
Jatan