Skip site navigation (1) Skip section navigation (2)

Re: Re: BUG #4123: Statement.setQueryTimeout does not work with Postgres Java Driver

From: Kris Jurka <books(at)ejurka(dot)com>
To: valgog <valgog(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: BUG #4123: Statement.setQueryTimeout does not work with Postgres Java Driver
Date: 2008-04-24 10:28:18
Message-ID: Pine.BSO.4.64.0804240622340.11234@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-bugs

On Wed, 23 Apr 2008, valgog wrote:

> Is it possible to implement the setStatementTimeout() as somethig
> like:
>
> s = c.prepareStatement("SELECT set_config('statement_timeout',
> <neededTimeoutInMilliseconds>, false);" );
> s.executeQuery();
> c.commit();
>

Not really.  This sets a global timeout for all queries while the JDBC API 
specifies that it is per-Statement.  Also this only protects against long 
running queries.  Recently there was some discussion on the JDBC list 
about soft vs hard timeouts and it seemed the conclusion was that people 
wanted setQueryTimeout to protect against things like the network 
connection dropping that statement_timeout can't do.

In many cases statement_timeout is an adequate substitute for 
setQueryTimeout, but not in the general case that the JDBC driver must 
implement.

Kris Jurka

In response to

Responses

pgsql-bugs by date

Next:From: spol@mail.ruDate: 2008-04-24 11:19:42
Subject: Re: HELP pls
Previous:From: Peter KoczanDate: 2008-04-23 17:17:01
Subject: BUG #4126: KRB5/GSSAPI authenication fails for multipart kerberos principals

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group