Skip to content
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

【书籍勘误】第7章 MyBatis缓存配置 p183 readOnly 介绍一段 #64

Open
guoyufu-study opened this issue Nov 20, 2018 · 1 comment

Comments

@guoyufu-study
Copy link

原文中有这样一句话:
只读缓存会给所有调用者返回缓存对象的相同实例,因此这些对象不能被修改,这提供了很重要的性能优势。

我测试得到的结论如下:
readOnly = true 只读时,缓存命中就会返回缓存实例的相同实例;
好处是具有性能优势。
劣势是不安全,由于是相同实例,一改全改。注意:对象是可以修改的

疑问:书中的原话是不是表述有问题,或者是我理解有问题?

@abel533
Copy link
Contributor

abel533 commented Nov 22, 2018

可以修改。。这里是建议这些对象不能被修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants