pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Rainer Frey <rainer.frey@inxmail.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #1459: Connection hangs when other connection is not committed
Date: Fri, 4 Feb 2005 15:15:00 +0100
Message-ID: <200502041515.00657.peter_e@gmx.net> (raw)
In-Reply-To: <42035480.2060707@inxmail.de>
References: <20050203151126.467DC9A5818@www.postgresql.com>
	<200502041054.16723.peter_e@gmx.net>
	<42035480.2060707@inxmail.de>

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/



view thread (6+ messages)  latest in thread

Message-ID: <200502041515.00657.peter_e@gmx.net>
Permalink:  ../200502041515.00657.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200502041515.00657.peter_e@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: peter_e@gmx.net, rainer.frey@inxmail.de, pgsql-bugs@postgresql.org
  Subject: Re: BUG #1459: Connection hangs when other connection is not committed
  In-Reply-To: <200502041515.00657.peter_e@gmx.net>
  References: <20050203151126.467DC9A5818@www.postgresql.com> <200502041054.16723.peter_e@gmx.net> <42035480.2060707@inxmail.de> <200502041515.00657.peter_e@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox