From: Radosław Smogura <rsmogura@softperience.eu>
To: Craig Ringer <ringerc@ringerc.id.au>
Cc: David Fetter <david@fetter.org>
Cc: Sylvain Mougenot <smougenot@sqli.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?
Date: Thu, 15 Dec 2011 12:29:58 +0100
Message-ID: <c138137e3524335c64e646b0e88e7dbc@mail.softperience.eu> (raw)
In-Reply-To: <4EE97B85.50909@ringerc.id.au>
References: <CACKdPFjK_UsZ5wExD-RvBbvi6Zo-VYtoxQsCUpWXzTN9kywj7w@mail.gmail.com>
<4EE8AC41.2040505@ringerc.id.au>
<20111214161349.GA31176@fetter.org>
<4EE968FF.5010604@ringerc.id.au>
<4EE97B85.50909@ringerc.id.au>
Long, long time ago I've sent implementation with timers, you need to
search archive If you need this.
Regards,
Radek
On Thu, 15 Dec 2011 12:45:57 +0800, Craig Ringer wrote:
>> I've popped a question up here:
>>
>>
>
> http://stackoverflow.com/questions/8514725/obtaining-a-java-util-timer-or-equivalent-in-a-javaee-fri...
>> [1]
>>
>> to see if I can get some broader input on the issue of portable
>> timers.
>
> ... and boy am I glad I did, thanks to Bauke Scholtz (BalusC) on SO.
>
> It looks like we can probably use a ScheduledThreadPoolExecutor
> safely from within a Java EE container or servlet container, so long
> as:
>
> - We never let EE application code that requires EE services - like
> servlet code, EJBs, etc - run on its thread(s); and
>
> - We use a ServiceLoader in /META-INF/services to destroy it when
> the
> JDBC driver is unloaded, the war
> the JDBC driver is bundled in is undeployed or the app server is
> stopped;
>
> That should provide the JDBC driver with a suitable timer mechanism.
>
> Perhaps more excitingly, a generic ThreadPoolExecutor can be safely
> used within an EE container the same way, potentially allowing the
> JDBC driver to use threads for blocking I/O. That'd finally permit a
> version of PgConnection.getNotifications() that can be safely invoked
> without blocking when SSL is in use!
>
> A driver thread pool could also help permanently fix those
> occasional
> deadlocks that happen due to buffer management issues in the JDBC
> driver.
>
> I'll try to find time to do some testing and see if I can make this
> work or at least bash out a proof of concept.
>
> --
> Craig Ringer
>
>
> Links:
> ------
> [1]
>
> http://stackoverflow.com/questions/8514725/obtaining-a-java-util-timer-or-equivalent-in-a-javaee-fri...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rsmogura@softperience.eu, ringerc@ringerc.id.au, david@fetter.org, smougenot@sqli.com, pgsql-jdbc@postgresql.org
Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this?
In-Reply-To: <c138137e3524335c64e646b0e88e7dbc@mail.softperience.eu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox