Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: help understand my lock
Not knowing what tfslock does, my guess is that you ARE trying to lock
the same row.
The value of 0 is a valid row number in the block, it is simply the
first row in this block.
I can reproduce the effect of showing 0 in v$session.row_wait_row# for
the waiting session using the following scenario:
Session 8
create table div (id number, text varchar2(10));
create index div_pk on div (id);
alter table div add constraint div_pk primary key (id);
insert into div values (1,'One');
commit;
select * from div where id = 1 for update;
Session 11
update div set text='Another' where id = 1;
...hangs....
select sid,row_wait_obj#,row_wait_file#,row_wait_block#,row_wait_row# from v$session where sid in (8,11);
SID ROW_WAIT_OBJ# ROW_WAIT_FILE# ROW_WAIT_BLOCK# ROW_WAIT_ROW# ---------- ------------- -------------- --------------- -------------
8 -1 0 0 0 11 12873 4 133 0
On the other hand, if I create another row in the table, then same scenario:
Session 8
rollback;
insert into div values (2,'Two');
commit;
select * from div where id = 2 for update;
Session 11
rollback;
update div set text='Another' where id = 2;
...hangs....
select sid,row_wait_obj#,row_wait_file#,row_wait_block#,row_wait_row# from v$session where sid in (8,11);
SID ROW_WAIT_OBJ# ROW_WAIT_FILE# ROW_WAIT_BLOCK# ROW_WAIT_ROW# ---------- ------------- -------------- --------------- -------------
8 -1 0 0 0 11 12875 4 133 1
Now Session 11 is waiting on the second row in the block. Received on Sun Mar 19 2006 - 11:32:05 CST