when I stop my server it does not release Exclusive lock it gained earlier.
Hi There I have a java web application which uses Postgres 9.3. Whenever the web server starts it takes a database lock using the following query:
select pg_try_advisory_lock(100);But when I stop the server it does not release Exclusive lock it gained earlier.
postgres=# SELECT pl.pid,datname,mode, state FROM pg_locks pl LEFT JOIN pg_stat_activity psa ON pl.pid = psa.pid;oneproduct is the database that java app uses(it took the lock on)
pid | datname | mode | state
-------+----------------------+-----------------+--------
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | ExclusiveLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
27669 | oneproduct | ExclusiveLock | idle
(10 rows)
To my knowledge When a client of Postgres stops or kill or dies all the Locks are released, correct me if I am wrong.
when I check this PID 27669 it is in the sleeping state but its peer is already dead.
Why it's still holding the ExclusiveLock?
No any search results
You already invited:
0 Answers