Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: help understand my lock

Re: help understand my lock

From: <krichine_at_juno.com>
Date: 19 Mar 2006 09:32:05 -0800
Message-ID: <1142789525.872474.314930@j33g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US