
无论对MySQL数据库进行什么更改,这些更改在同一事务中都可读吗?还是我应该提交交易以读取更改?
我可以轻松地测试一下.但是在SO中提出问题会带来很多好的建议.感谢您的任何投入.
最佳答案假设您使用的是InnoDB,第一个问题的答案通常是肯定的,这意味着第二个问题的答案通常是否.默认情况下,MysqL的InnoDB使用一种称为consistent non-locking reads的技术:
The query sees the changes made by
transactions that committed before
that point of time,and no changes
made by later or uncommitted
transactions. The exception to this
rule is that the query sees the
changes made by earlIEr statements
within the same transaction.
话虽这么说,关于交易还有很多事情要知道.您可以更改isolation level of a transaction以更彻底地控制交易结果.
关于InnoDB Transaction Model的章节是一个很好的起点. 总结
以上是内存溢出为你收集整理的mysql-从事务内读取更改 全部内容,希望文章能够帮你解决mysql-从事务内读取更改 所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)