Demonstration of isolation levels for transactions: Demonstration of serialization

1.1.1 Demonstration of serialization
l Open two windows A, B
l Set the isolation level of window A: serializable
SET SESSION TRANSACTION ISOLATION LEVEL serializable;
Demonstration of isolation levels for transactions: Demonstration of serialization
l Open transactions in two windows respectively:
start transaction;
Demonstration of isolation levels for transactions: Demonstration of serialization
l Insert in window B A record
insert into account values ​​(null,'Xiao Li',10000);
Demonstration of isolation levels for transactions: Demonstration of serialization
l Query
select * from account in the A window;
***** found that the A window has been stuck (indicating that the transaction does not allow concurrency, A The window needs to wait for the completion of the transaction of window B before executing the transaction of window A.) When the transaction of window B ends (commit or rollback), the result of window A will appear immediately.

Guess you like

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