emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

How auto load xml configure file when file changed? #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
when i develop with ibatis, I modify xml frequency, and ibatis don't reload it, 
so i
need restart web server every time when i write new sql. Can ibatis auto load 
xml configure file when file changed?

Original issue reported on code.google.com by glg...@gmail.com on 12 Sep 2010 at 5:19

GoogleCodeExporter commented 9 years ago
any help?

Original comment by glg...@gmail.com on 13 Sep 2010 at 3:34

GoogleCodeExporter commented 9 years ago
No. It cannot. But you can code it easily by your own.

You just need to reload your SqlSessionFactory calling the 
SqlSessionFactoryBuilder.build when you detect the file has changed.

Have a look for example to FileWatchDog.java from log4j. It should work for you 
almost as it is.
http://www.koders.com/java/fid84EFF8C1B72CD29CE7580179376203437D01C7CE.aspx

Original comment by eduardo.macarron on 5 Jan 2011 at 3:32