之后
create table l (id int primary key, val int);
insert into l values (0, 0);
并初始化两个 oracle 会话
alter session set isolation_level=serializable;
以下连续导致ORA-08177: can't serialize access for this transaction
.
session 1 session 2
-----------------------------------+-----------------------------------
lock table l in exclusive mode
-----------------------------------+-----------------------------------
lock table l in exclusive mode
-----------------------------------+-----------------------------------
update l set val = 1 where id = 0 [blocked]
-----------------------------------+-----------------------------------
commit [blocked]
-----------------------------------+-----------------------------------
update l set val = 2 where id = 0
-----------------------------------+-----------------------------------
[ORA-08177]
这是为什么?对我来说,它看起来非常连续。