That's not runtime, either. :) I think Alex's solution is adequate for the original question, but if you really want to change it up on the fly, you should be able to easily replace the SSF (assuming you have it as a singleton) the same way - and if you add a function to your app that does it...bam, you're done.
BTW (and only semi[ot]), I've been really pleased with how the configuration API has changed in ibatis3. This kind of stuff is SO much easier now. :-D Larry 2010/4/28 Björn Raupach <raup...@e2n.de>: > 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org