Re: [JDBC] Support for JDBC setQueryTimeout, et al.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, rsmogura(at)softperience(dot)eu, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al.
Date: 2010-10-12 19:29:35
Message-ID: 4983.1286911775@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

David Fetter <david(at)fetter(dot)org> writes:
> Let's imagine you have a connection pooler with two clients, A and B.
> A calls setQueryTimeout, then starts a query, which terminates in
> time, but dies before handling it. B connects to the pool, gets A's
> connection, and finds a statement_timeout that's not the default, even
> though only A's single query was supposed to have that
> statement_timeout. This is not a situation that can be resolved
> without being able to set a timer *on the server side*.

Actually, that seems like a fine argument why this should *not* be
implemented on the server side... although I would expect a connection
pooler to roll back GUC changes when switching users, so the argument
seems to presume several rather broken implementation decisions in
order to make the scenario possible.

> While I'd *like* to put in a whole infrastructure for setting GUCs on
> a per-statement basis, I don't believe that we need to get out that
> giant sledgehammer for this case, even though it's worth solving.

You'd need to first convince people that SET LOCAL doesn't solve the
problem well enough already.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-10-12 19:50:22 Re: Which file does the SELECT?
Previous Message Peter Geoghegan 2010-10-12 19:17:47 Re: ISN patch that applies cleanly with git apply

Browse pgsql-jdbc by date

  From Date Subject
Next Message Juan Argandoña 2010-10-12 23:55:47 PSQLException: An I/O error occured while sending to the backend
Previous Message Magnus Hagander 2010-10-12 18:03:29 Re: [JDBC] Support for JDBC setQueryTimeout, et al.