-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
二级缓存问题 #11
Comments
在书中 表4-1 MyBatis所有属性的含义 其中对于cacheEnable 作用的描述说:是否开启mapper缓存,即二级缓存,true标识默认开启。 |
在Configuration类中,用到了这个CacheEnable只有在创建Executor中才用到。 |
默认开启,也就是说 在MyBatis主配置文件中指定cacheEnabled属性值为true 这个是可以不需要配置的。 |
@loutongtong @yulangde 感谢提出疑问, 确实有点问题,cacheEnable是控制二级缓存的全局开关,默认是开启的。除此之外,二级缓存只有配置了cache标签才会开启,所以默认情况下不配置cache标签也是不开启的,表述上有点问题,我修改一下通知出版社 QQ群因为资料未完善,所以过了一段时间就搜不到了,现在已经可以了 |
org.apache.ibatis.builder.xml.XMLConfigBuilder#settingsElement 这个方法中有这么一行代码:
configuration.setCacheEnabled(booleanValueOf(props.getProperty("cacheEnabled"), true));
意思不就是默认开启二级缓存的吗?《Mybatis3源码深度解析》,7.4章节说默认关闭的,是不是有点问题?
(PS:QQ群找不到啊,企鹅群:1055227297,是这个吗?搜不到~~ 我QQ 1032817876 )
The text was updated successfully, but these errors were encountered: