Mybatis快速实现读写分离

首先我们来了简单介绍一下mybatis的架构图   mybatis 通过 解析 mybatis.xml 拿到 configuration 返回一个SqlSessionFactory    然后通过 SqlSessionFactory 拿到一个SqlSession  注意这里 创建 Excutor的同时把他加入到了 intreceptorChain 里面。这里用到了观察者模式 类似于 zookeep
相关文章
相关标签/搜索