Re: Implementing setQueryTimeout() - round 2 - Mailing list pgsql-jdbc

From Michael Paesold
Subject Re: Implementing setQueryTimeout() - round 2
Date
Msg-id 47BB0249.7070204@gmx.at
Whole thread Raw
In response to Re: Implementing setQueryTimeout() - round 2  (Kris Jurka <books@ejurka.com>)
List 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


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Implementing setQueryTimeout() - round 2
Next
From: Paul Tomblin
Date:
Subject: How to find what Java program has a transaction open?