-
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),
- 该怎么理解两者的不同呢,难道这两者本来就是各玩各的吗