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

Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?

From: Radosław Smogura <rsmogura(at)softperience(dot)eu>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: David Fetter <david(at)fetter(dot)org>, Sylvain Mougenot <smougenot(at)sqli(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?
Date: 2011-12-15 20:48:43
Message-ID: aeb1b41005080939f1552e34e49b6902@mail.softperience.eu (view raw or flat)
Thread:
Lists: pgsql-jdbcpgsql-sql
On Thu, 15 Dec 2011 22:02:43 +0800, Craig Ringer wrote:
> On 12/15/2011 07:29 PM, Radosław Smogura wrote:
>> Long, long time ago I've sent implementation with timers, you need 
>> to search archive If you need this.
>
> If it was ages ago, you probably used java.util.Timer, right?
>
> java.util.Timer is not suitable for use in a JDBC driver because it
> doesn't do any exception handling on the timer thread, it's subject 
> to
> congestion on the timer thread, and it offers no way for the driver 
> to
> control the timer thread to cleanly shut it down during unload. It's
> unusable in app servers and not really a great idea anywhere that
> needs to be robust and long-running.
>
> --
> Craig Ringer
Indeed it was Timer with subclassed TimerTask. In any way 
implementation was that it was prepared for choosing per connection (and 
per connection is used during normal execution), per data source, or per 
class loader (this is used in case of data sources).

For shutting down implementation is clear thread associated with Timer 
will go away if no more tasks are scheduled and there is no more 
references to Timer. Demonizing timer is quite enough.

 From implementation if I recall well I used a little bit different 
concept to create "atomic" operations chain for query executor protected 
in addition with timer - and I think this concept was fully realized.

Regards,
Radosław Smogura

In response to

pgsql-sql by date

Next:From: Radosław SmoguraDate: 2011-12-15 20:49:02
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?
Previous:From: Steven SchlanskerDate: 2011-12-15 17:38:48
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?

pgsql-jdbc by date

Next:From: Radosław SmoguraDate: 2011-12-15 20:49:02
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?
Previous:From: Steven SchlanskerDate: 2011-12-15 17:38:48
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?

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