modify mybatis session factory initializer, and resolve some bugs.