Detecting locks

Started by Sebastian Bossungalmost 25 years ago2 messagesgeneral
Jump to latest
#1Sebastian Bossung
bossung@gmx.de

Hi,

how do you find out if a row is locked _before_ using SELECT ... FOR UPADTE
on it. The SELECT will wait for the lock to be removed (if there was one),
making the user think the app crashed.

Sebastian

--
Sebastian Bo�ung - bossung@gmx.de
http://www.bossung.org
# The idea is to die young as late as possible.

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Sebastian Bossung (#1)
Re: Detecting locks

Sebastian Bossung writes:

how do you find out if a row is locked _before_ using SELECT ... FOR UPADTE
on it. The SELECT will wait for the lock to be removed (if there was one),
making the user think the app crashed.

There is currently no way to detect locks. You could implement a timeout
in your application after which you send a query cancel. A waiting lock
still distinguishes it from a crashed program, ISTM.

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter