Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 7009DCBE9C3 for ; Thu, 15 Dec 2011 13:39:13 -0400 (AST) Received: from mail-ee0-f46.google.com ([74.125.83.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RbFGu-0006ST-Pt for pgsql-jdbc@postgresql.org; Thu, 15 Dec 2011 17:39:13 +0000 Received: by eekc4 with SMTP id c4so2338861eek.19 for ; Thu, 15 Dec 2011 09:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=PiNdsdj8KPF1A3x8net4w1aqJC0NCHQJTIyRdqUqmAk=; b=uZmAPb2UsVM/hRNHUgRpX9KxEt8xOZN/atCpMvb5qWqmqMSVtQVEoqtMb1P6Gs2vi2 alHRV6+nhIUM8K8wg3y2/hWf7T5VnjGVl6731wuQCEaTpHTjYRhy3lBwJkIEwdPb4oSa Io6qOjtln/RrrWMOFQtlcaCkhuat9kK9Et9sI= Received: by 10.180.7.198 with SMTP id l6mr7188582wia.3.1323970735806; Thu, 15 Dec 2011 09:38:55 -0800 (PST) Received: from sexy.corp.trumpet.io ([207.86.77.58]) by mx.google.com with ESMTPS id gn4sm9243565wib.20.2011.12.15.09.38.51 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Dec 2011 09:38:53 -0800 (PST) Subject: Re: Re: [SQL] JDBC Statement.setQueryTimeout : is there plan to implement this? Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=utf-8 From: Steven Schlansker In-Reply-To: Date: Thu, 15 Dec 2011 09:38:48 -0800 Cc: Craig Ringer , =?utf-8?Q?Rados=C5=82aw_Smogura?= , David Fetter , Sylvain Mougenot , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <0A239648-B5D6-4E58-B67B-8257AD2AA516@gmail.com> References: <4EE8AC41.2040505@ringerc.id.au> <20111214161349.GA31176@fetter.org> <4EE968FF.5010604@ringerc.id.au> <4EE97B85.50909@ringerc.id.au> <4EE9FE03.7070107@ringerc.id.au> To: Dave Cramer X-Mailer: Apple Mail (2.1251.1) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/64 X-Sequence-Number: 22518 java.util.concurrent introduces ScheduledExecutorService, which fixes a = lot of the problems with java.util.Timer and introduces more features. Specifically, it enqueues timed actions and executes them on a thread = pool, providing good controls both for controlling individual tasks = (canceling) and the entire pool (shutting down cleanly / immediately) It might be a good fit for implementing timeouts. On Dec 15, 2011, at 6:17 AM, Dave Cramer wrote: > Craig, >=20 > That is the current implementation. What do you suggest as a more > robust implementation ? >=20 > Dave Cramer >=20 > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca >=20 >=20 >=20 > On Thu, Dec 15, 2011 at 9:02 AM, Craig Ringer = wrote: >> On 12/15/2011 07:29 PM, Rados=C5=82aw Smogura wrote: >>>=20 >>> Long, long time ago I've sent implementation with timers, you need = to >>> search archive If you need this. >>=20 >>=20 >> If it was ages ago, you probably used java.util.Timer, right? >>=20 >> 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. >>=20 >> -- >> Craig Ringer >>=20 >>=20 >> -- >> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-jdbc >=20 > --=20 > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc