Back to the third day of javaweb (three) (transactions about the database, etc.)

 

 

Atomicity, consistency, isolation, durability

Atomicity: both executed and not executed

Consistency: keep the same, one will lose XX yuan, the other will increase XX yuan

Isolation: The impact of two transactions is isolated.

Persistence: The impact on database operations is persistent.

 

 

 

 

 

 

 

 

 Said here:

1.SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED Set the isolation level of the database, you can read the uncommitted data, dirty reading

2. After you begin to set the name with id 1 to bob, the other one read is the name bob

3. But if the database system 1 rolls back , the data read by the database system 2 is still unmodified

It means: If the level is set to: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED, then it is OK

A database system may be able to read another database system modified but not submitted data.

After the rollback, another database system system reads the data before the rollback.

 

 

 

 

 

 

 

 

The isolation levels of the four transactions are compared

Transaction B does not know the existence of transaction A. Even if it is read 100 times, the value read should be the previous value.

So the correct reading is to read only once.

Guess you like

Origin www.cnblogs.com/startFrom0/p/12680931.html