Five transaction isolation levels of spring

1) DEFAULT (default) 
This is the default isolation level of a PlatfromTransactionManager, using the default transaction isolation level of the database. The other four correspond to the isolation level of JDBC 

2) READ_UNCOMMITTED (read uncommitted) 
This is the lowest isolation level of the transaction, it Allows another transaction to see uncommitted data from this transaction. This isolation level produces dirty reads, non-repeatable reads and phantom reads. 

3) READ_COMMITTED (read committed) 
ensures that data modified by one transaction can only be read by another transaction after it is committed. Another transaction cannot read the transaction's uncommitted data. This transaction isolation level can avoid dirty reads, but non-repeatable reads and phantom reads may occur. 

4) REPEATABLE_READ (repeatable read) 
This transaction isolation level can prevent dirty reads and non-repeatable reads. However, phantom reads may occur. In addition to ensuring that a transaction cannot read uncommitted data of another transaction, it also ensures non-repeatable read 

5) SERIALIZABLE (serialization) 
This is the most expensive but most reliable transaction isolation level. Transactions are processed for sequential execution. In addition to preventing dirty reads, non-repeatable reads, it also avoids phantom reads. 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325144549&siteId=291194637