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 Yusuf <Yu...@ekalife.co.id> on 2006/06/15 05:58:46 UTC

Reloading sqlmaps

Hello, congrats for the successfull implementation of iBatis as one of
the tools used on the dzone website :)

i'm sorry if this is not the right place to ask (spring-related), but is
there anyway to reload the sqlmaps definition without reloading the
entire application?
for example, we use spring to load the bean definitions, like this : 

    <bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocation"
value="WEB-INF/sql-map-config.xml"/>
		<property name="dataSource" ref="dataSource"/>
    </bean>

but usually if we have some minor changes, like additional column to
tables, we have to reload the entire context,
is there anyway or some utils from ibatis that can be used to reload the
xml? 

i also tried like this

WebApplicationContext wac =
WebApplicationContextUtils.getWebApplicationContext(request.getSession()
.getServletContext());
SqlMapClient sqlMapClient = (SqlMapClient) wac.getBean("sqlMapClient");
Reader reader = Resources.getResourceAsReader("../sql-map-config.xml");
sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);

to reinstantiate the new sqlmap, but the sqlmap still referenced to the
old one..

thank you,
yusuf.