Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with selecting/updating rows
Hi,
Both sessions should use select ... for update to lock row. And I prefer select ... for update nowait.
Andrew Protasov
> I'm having a problem with selecting and updating rows on a table by two
> concurrent users.
> I was wondering if anybody knows a way to prevent a second user from
> SELECTING the same row that a first user has already selected.
>
> My problem is this:
> User one selects a row, validates that row and then updates the status of
> that row. While User one is doing this, User two goes and selects that same
> row, validates the row and fails because User one has already updated the
> status of that row and is no longer valid for my operation.
>
> What I want is this:
> User one selects a row and HIDES/LOCKS that row from the next User,
> validates that row and then updates the status of that row. While User one
> is doing this, User two selects the next row (not the row User one is
> working on) and HIDES/LOCKS that row from the next user, validates that row
> and then updates the status of that row. This will prevent Users
> interfering with each-other's work.
>
> Your HELP would be greatly appreciated.
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> Dennis R. Leon
> dleon_at_rim.net
>
> Research In Motion Ltd.
> Voice: (519) 748-2100 x328
> Fax: (519) 748-4532
> http://www.rim.net
>
>
>
>
Received on Mon Nov 09 1998 - 11:53:13 CST
![]() |
![]() |