Thread: Transaction automatically rollback but why?

Transaction automatically rollback but why?

From
Muhammad Shariq Muzaffar
Date:
Hi
I am using pgsql 7.3.1. I am trying to implement an
explicit lock at row level using FOR UPDATE with
SELECT query.

In current scenario I have 2 users. I have a table
'mytable' having a field 'std' with 6 records. First
user have got first 3 records locked and the second
user have locked the last 3 records. Now if the second
user try to lock a row which is already locked by the
first user, pgsql rollbacks the transaction for the
second user and unlock the records locked by the
second user. WHY????

Is there any way that pgsql gives only some error and
do not rollback the transaction.

thanx in advance.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com