- 论坛徽章:
- 0
|
create table "informix".add
(
a char(10),
b char(10)
) extent size 16 next size 16 lock mode row;
create unique index "informix".a01 on "informix".add (a) ;
我在一個資料庫stores7 中建立了上面的add表格設置為行鎖,資料庫是unbuffer日誌模式的.插入下面的數據
insert into add values("1","777");
insert into add values("2","777");
我開啟了第一個會話,
begin work;
set isolation to committed read;
set lock mode to wait 5;
update add set b=888 where a=1;
沒有問題.
第二個會話
begin work;
set isolation to committed read;
set lock mode to wait 5;
update add set b=888 where a=2;
5秒后提示記錄被鎖.
爲什麽是這樣?我對行鎖的邏輯亂了...
|
|