读提交级别下的实践
事务1 | 事务2 |
---|---|
BEGIN | |
select *, xmin, xmax from time_test; | |
update time_test set time = '1456' where id = 1; | |
select *, xmin, xmax from time_test; | |
BEGIN; | |
update time_test set time = '1457' where id = 1; | |
select *, xmin, xmax from time_test; | |
select *, xmin, xmax from time_test for update; | 与事务2未提交的update冲突,导致两个事务回滚。 |