Subject | Re: Fwd: How to avoid deadlock ? |
---|---|
Author | Dmitry Yemanov |
Post date | 2012-01-16T03:50:01Z |
15.01.2012 23:58, Vander Clock Stephane wrote:
transaction as INSERT, then neither SELECT WITH LOCK nor UPDATE should
wait. If the transactions are different, then both should wait. In this
latter case, SELECT WITH LOCK will not wait only if you have already
updated the record in the same (second) transaction, but again, the same
applies to the regular UPDATE.
Dmitry
>I don't get the point, sorry. If you perform SELECT in the same
> now yes it's work like i want ...
>
> juste one remark, the with lock have a little weakness
> again the equivalent lock with update ...
>
> ex :
>
> TranstactionStart
> Insert ... fieldA=1;
>
> then
>
> Select ... where FieldA=1 with lock
>
> => return immediately :(
transaction as INSERT, then neither SELECT WITH LOCK nor UPDATE should
wait. If the transactions are different, then both should wait. In this
latter case, SELECT WITH LOCK will not wait only if you have already
updated the record in the same (second) transaction, but again, the same
applies to the regular UPDATE.
Dmitry