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

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Rainer Frey <rainer(dot)frey(at)inxmail(dot)de>, pgsql-bugs(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: BUG #1459: Connection hangs when other connection is not
Date: 2005-02-04 19:35:41
Message-ID: 4203CE8D.1050301@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

Peter Eisentraut wrote:
> Am Freitag, 4. Februar 2005 11:54 schrieb Rainer Frey:
>
>>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.

JDBC has a couple of mechanisms that may be more portable than fiddling
with statement_timeout directly:

- Statement.setQueryTimeout(). This is *not* implemented by the current
driver (it is a no-op), but shouldn't be too hard to implement as
mapping to statement_timeout if you feel inclined to do some driver hacking.

- Statement.cancel(). This is implemented by the current driver, but you
will need to build your own infrastructure to handle doing the cancel
from a separate thread if a query takes too long.

-O

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kris Jurka 2005-02-04 21:41:26 Re: BUG #1459: Connection hangs when other connection is not
Previous Message Prabin Gade 2005-02-04 16:16:12 BUG #1461: pg_restore fails to authenticate on win

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-02-04 19:52:23 Re: jar naming consitency
Previous Message Peter Eisentraut 2005-02-04 19:01:25 Re: jar naming consitency