I tried web based applications using java, because all services are
run by files from the one server.
1. i have executed a query 'SELECT FOR UPDATE'.
2. select * from "pg_locks"; it will returns,
relation(oid) | database(oid) | transaction | pid | mode | granted
3131286 3131432 1212 121 row share lock t
3. Then extract the pid from this table using the following query
select pid from "pg_locks" where mode='RowShareLock' and
relation(oid)=3131286 and database(oid)=3131432 ;
This will return the pid.We can inform the user the row is locked by
checking if there is any pid corresponding to
Here the above query will return pid corresponding to each and every
lock made on any row in this table.
It is not specific to the row that I had locked. one solution proposed
is to create a primary key corresponding to this row when this row was
locked by user1.
Then we can use this primary key to inform the details about the row
which is currently locked.
But will this work with a window based appications using swing,SWT etc
using a centralised database.
How can i solve this problem?
thanks & regard
sydpug by date
|Next:||From: peter nkosi||Date: 2005-05-24 15:21:54|
|Previous:||From: users jtech softwares||Date: 2005-05-14 10:08:00|
|Subject: rowid of a record being locked for updation|