mongo 的文档里说默认隔离策略是 Read Uncommitted ,定义为“在事务提交之前,在事务中所做的数据更改在事务外部是不可见的”,原文是这样的“Until a transaction commits, the data changes made in the transaction are not visible outside the transaction.”,链接是 https://www.mongodb.com/docs/v4.2/core/read-isolation-consistency-recency/
而 spring 中对 Read Uncommitted 的定义是事务间可以互相读到未提交的更改
public enum Isolation {
/**
* A constant indicating that dirty reads, non-repeatable reads and phantom reads
* can occur. This level allows a row changed by one transaction to be read by
* another transaction before any changes in that row have been committed
* (a "dirty read"). If any of the changes are rolled back, the second
* transaction will have retrieved an invalid row.
* @see java.sql.Connection#TRANSACTION_READ_UNCOMMITTED
*/
READ_UNCOMMITTED(TransactionDefinition.ISOLATION_READ_UNCOMMITTED),
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.