This is not run-time. You must redeploy the application. Why not select the environment based on a property file? This way you only need to restart the application.
<environments default="${env}"> Looks like a nice feature. Is there anything to be said against it? On Apr 28, 2010, at 3:02 AM, Alex Park wrote: > Hi, > > SqlSessionFactoryBuilder.build() method can select a specific environment in > XML. > > For example, > > private Reader reader; > private SqlSessionFactory sqlSessionFactorys; > private SqlSession session; > > reader = Resources.getResourceAsReader("ibatis-config.xml"); > > sqlSessionFactorys = new SqlSessionFactoryBuilder().build(reader, "test"); > testSession = sqlSessionFactorys.openSession(); // test env > > sqlSessionFactorys = new SqlSessionFactoryBuilder().build(reader, "dev"); > devSession = sqlSessionFactorys.openSession(); // dev env > > > Thanks, > Alex > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org > For additional commands, e-mail: user-java-h...@ibatis.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org