ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yusuf" <Yu...@ekalife.co.id>
Subject Reloading sqlmaps
Date Thu, 15 Jun 2006 03:58:46 GMT
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.


Mime
View raw message