Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: prevent 2 users updating same row
hi,
you must use select .. for update .. (no wait)
user A: select * from miketable where user= 100 for update of
any_column_name;
user B: select * from miketable where user=100;
(can't see record before user a do commit, if use no wait some ora message
will appear)
lfto_at_my-deja.com wrote:
> hi, i have the following situation where user A and B select the
> same row...then A updates and commits....then B update commits..
> problem is user B overlays user A updates....i need to prevent this.
>
> the select for update only locks other users from updating...not reading
> any ideas?
>
> here's my sql..
>
> user A: select * from miketable where user= 100;
> user B: select * from miketable where user=100;
> user A: Update miketable where user=100;
> commit;
> user B: update miketable where user=100;
> commit;
>
> thanks
> mike
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Oct 03 2000 - 04:50:37 CDT
![]() |
![]() |