Re: [BUGS] BUG #1459: Connection hangs when other connection is not - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: [BUGS] BUG #1459: Connection hangs when other connection is not
Date
Msg-id 4203CE8D.1050301@opencloud.com
Whole thread Raw
Responses Re: [BUGS] BUG #1459: Connection hangs when other connection is not  (Kris Jurka <books@ejurka.com>)
List 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

pgsql-jdbc by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: jar naming consitency
Next
From: Oliver Jowett
Date:
Subject: Re: jar naming consitency