Re: Dead locks
Alfred Perlstein <bright@wintelcom.net>
From: Alfred Perlstein <bright@wintelcom.net>
To: Aristide Aragon <aristide@lionking.org>
Cc: pgsql-general@postgresql.org
Date: 2001-05-07T00:48:19Z
Lists: pgsql-general
* Aristide Aragon <aristide@lionking.org> [010506 17:40] wrote: > Hello > This question isn't about deadlocks, instead, it's about something > I've been wondering because of a program I'm doing that uses locks. > My progrm uses begin and commit (or rollback) and locks a table > in exclusive mode. What'd happen if the program unexpectedly died? > How would the database recover from a lock without a commit or > rollback? Would the database release the lock automatically, would > it be in deadlock or would I have to release it by hand, and if so > how? Please wrap lines at 70 characters. The database _should_ detect that the client has died because the database connection is usually a stream socket which notifies end points of disconnect/timeout. Once it detects that it _should_ be able to abort the current transaction and as part of that drop any locks held in that transaction. It _should_ but I'm not sure it does. -- -Alfred Perlstein - [alfred@freebsd.org] http://www.egr.unlv.edu/~slumos/on-netbsd.html