Re: BUG #1459: Connection hangs when other connection is not committed

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Rainer Frey <rainer(dot)frey(at)inxmail(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1459: Connection hangs when other connection is not committed
Date: 2005-02-04 14:15:00
Message-ID: 200502041515.00657.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

Am Freitag, 4. Februar 2005 11:54 schrieb Rainer Frey:
> Thanks for the explanation, though I don't really get the necessity of a
> commit for a read-only statement. Can't a SELECT release its lock after
> it received the response?

If that is the end of the transaction, then you might as well commit it then.
But what if you plan to do an update in the same transaction based on the
selection results? You can't release and reaquire locks in the same
transaction without getting into a bunch of trouble. Read up on "strict
two-phase locking" if you're curious.

> Is there any possibility to set a timeout for the lock, after which the
> ALTER TABLE statement fails, instead of remaining in wait status (when
> calling with JDBC?

Yes, there is a statement_timeout parameter or something like that.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Prabin Gade 2005-02-04 16:16:12 BUG #1461: pg_restore fails to authenticate on win
Previous Message Daniel 2005-02-04 12:05:01 BUG #1460: unable dwonloads

Browse pgsql-jdbc by date

  From Date Subject
Next Message Stéphane RIFF 2005-02-04 15:34:28 Re: [SPAM] - Re: [SPAM] - Re: JDBC HighLoad - Found word(s)
Previous Message Dave Cramer 2005-02-04 14:11:00 Re: [SPAM] - Re: [SPAM] - Re: JDBC HighLoad - Found word(s)