Re: Implementing setQueryTimeout() - round 2

From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Oliver Jowett <oliver(at)opencloud(dot)com>, PostgreSQL - JDBC <pgsql-jdbc(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>
Subject: Re: Implementing setQueryTimeout() - round 2
Date: 2008-02-19 16:22:33
Message-ID: 47BB0249.7070204@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote:
> On Tue, 19 Feb 2008, Oliver Jowett wrote:
>
>> Add 4 new connection parameters, associated connection / statement
>> values and accessors on the postgresql extension interfaces:
>>
>> - softQueryTimeout: 0=disabled, >0 = timeout in ms, default 0
>> - hardQueryTimeout: 0=disabled, >0 = timeout in ms, default 0
>> - softQueryMargin: -1=disabled, >=0 = margin in ms, default 0
>> - hardQueryMargin: -1=disabled, >=0 = margin in ms, default 60s
>>
>> Any comments on this iteration? Too configurable? Not configurable
>> enough? Are the defaults sensible?
>>
>
> Sounds too configurable. I don't understand the use case for
> softQueryMargin at all right now. Since hardQueryTimeout +
> hardQueryMargin should be > softQueryTimeout + softQueryMargin for a
> reasonable configuration, we don't need all these parameters. Don't you
> just want:
>
> 1) defaultQueryTimeout: 0=disabled, >0 timeout in ms
> 2) hardTimeoutMargin: -1 disabled, >=0 hard timeout above query timeout

+1 from me, sounds easier to grasp, and looks like it would be
everything Oliver needs, too. Oliver?

setQueryTimeout() could by default only set "soft" timeout
(hardTimeoutMargin set to -1)

If hardTimeoutMargin is set to >= 0 you will get hard timeouts at
setQueryTimeout + margin. Margin can be 0 of course.

If you want to have soft/hard timeout for all queries, you set one or
both parameters.

Any use cases not working with just these two parameters?

Best Regards
Michael Paesold

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Tomblin 2008-02-20 01:34:05 How to find what Java program has a transaction open?
Previous Message Kris Jurka 2008-02-19 10:01:14 Re: Implementing setQueryTimeout() - round 2