Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Ora-00060 Deadlock Problem. Select for update behavior.
Comments inline.
Madhu Konda wrote:
>
> ...
>
> When using "select ... for update" should not processB wait till processA
> commits. So technically, they should not see the same rows at all because there is
> only one process working on the table at any time. Please correct me if I am wrong.
Yes, you are not totally correct. B may not *finish* until A commits. But it may *start* its work. And if both start the sequence they proceed is undefined. If the processing sequence of the rows were always the same no deadlock would occur but one process B would wait for A or vice versa.
>
> ...
>
> Since I cannot issue exclusive lock because inserts are happening, I can issue "lock
> table in row share mode" which is the same lock as select .. for update. Is there
> a difference in one vs the other?
Yes, the share lock will not keep the second process B from starting.
Try with "delete ... where rownum <= 1".
Martin Received on Wed Jun 06 2001 - 19:05:00 CDT