SSM-MyBatis-06:Mybatis中openSession到底做了什么
------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 1.找SqlSesionFactory实现类 Ctrl+H:DefaultSqlSessionFactory: Ctrl+F :openSession()方法 原型如下: public SqlSession openSession() { return this.openSessionFromDataSource(this.configuration.getDefaultExecutorType(), (TransactionIsolationLevel)null, false); } 2.查看openSessionFromDataSource方法的实现 private SqlSession openSessionFromDataSource(ExecutorType execType, TransactionIsolationLevel level, boolean autoCommit) { Transaction tx = null; 定义事务对象 很明显:SqlSession实现类 De...