From joel@gluefinance.com Wed Nov 30 12:07:20 2011 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5A9171178C45 for ; Wed, 30 Nov 2011 08:07:20 -0400 (AST) Received: from mail-gy0-f174.google.com ([209.85.160.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RViwU-0006zJ-OX for pgsql-hackers@postgresql.org; Wed, 30 Nov 2011 12:07:19 +0000 Received: by ghrr1 with SMTP id r1so530428ghr.19 for ; Wed, 30 Nov 2011 04:07:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.190.99 with SMTP id d63mr3010435yhn.73.1322654821153; Wed, 30 Nov 2011 04:07:01 -0800 (PST) Received: by 10.236.108.37 with HTTP; Wed, 30 Nov 2011 04:07:01 -0800 (PST) Date: Wed, 30 Nov 2011 13:07:01 +0100 Message-ID: Subject: Java LISTEN/NOTIFY client library work-around From: Joel Jacobson To: pgsql-hackers@postgresql.org Content-Type: multipart/alternative; boundary=20cf305e25a5c67a4404b2f292a6 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201111/1716 X-Sequence-Number: 199200 --20cf305e25a5c67a4404b2f292a6 Content-Type: text/plain; charset=ISO-8859-1 Hi, As you know, LISTEN/NOTIFY is broken in the Java client library. You have to do a SELECT 1 in a while-loop to receive the notifications. http://jdbc.postgresql.org/documentation/head/listennotify.html Is there some other library with a proper implementation where you don't have to spam the database with queries to get the notifications? If not, my company is willing to sponsor development of a patch fixing this problem. -- Best regards, Joel Jacobson --20cf305e25a5c67a4404b2f292a6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

As you know, LISTEN/NOTIFY is broken in the Java cli= ent library. You have to do a SELECT 1 in a while-loop to receive the notif= ications.


Is there some other library with a proper implementatio= n where you don't have to spam the database with queries to get the not= ifications?

If not, my company is willing to spons= or development of a patch fixing this problem.

--
Best regards,

Joel Jacobson
--20cf305e25a5c67a4404b2f292a6-- From wulczer@wulczer.org Wed Nov 30 12:27:37 2011 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 1E2CD1178C45 for ; Wed, 30 Nov 2011 08:27:37 -0400 (AST) Received: from wulczer.org ([109.74.195.157]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVjGB-0007JS-5I for pgsql-hackers@postgresql.org; Wed, 30 Nov 2011 12:27:36 +0000 Received: from [85.59.228.11] (helo=[10.0.0.101]) by wulczer.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RVjFw-0001aZ-9D; Wed, 30 Nov 2011 12:27:21 +0000 Message-ID: <4ED62127.8050902@wulczer.org> Date: Wed, 30 Nov 2011 13:27:19 +0100 From: =?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Joel Jacobson CC: pgsql-hackers@postgresql.org Subject: Re: Java LISTEN/NOTIFY client library work-around References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201111/1717 X-Sequence-Number: 199201 On 30/11/11 13:07, Joel Jacobson wrote: > Hi, > > As you know, LISTEN/NOTIFY is broken in the Java client library. You have > to do a SELECT 1 in a while-loop to receive the notifications. > > http://jdbc.postgresql.org/documentation/head/listennotify.html > > Is there some other library with a proper implementation where you don't > have to spam the database with queries to get the notifications? You mean a Java library? If Java is not a requirement, the psycopg2 Python library supports notifies well. Cheers, Jan From andrew@dunslane.net Wed Nov 30 13:58:24 2011 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id A25E0A01094 for ; Wed, 30 Nov 2011 09:58:24 -0400 (AST) Received: from 208-1-63-34.celito.net ([208.1.63.34] helo=smtpr.dunslane.net) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVkg3-0007vI-AQ for pgsql-hackers@postgresql.org; Wed, 30 Nov 2011 13:58:23 +0000 Received: from [192.168.10.146] (cpe-098-027-054-176.nc.res.rr.com [98.27.54.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtpr.dunslane.net (Postfix) with ESMTP id 5953832B3C1; Wed, 30 Nov 2011 08:58:08 -0500 (EST) Message-ID: <4ED6366C.7000602@dunslane.net> Date: Wed, 30 Nov 2011 08:58:04 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: =?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= CC: Joel Jacobson , pgsql-hackers@postgresql.org Subject: Re: Java LISTEN/NOTIFY client library work-around References: <4ED62127.8050902@wulczer.org> In-Reply-To: <4ED62127.8050902@wulczer.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -0.9 (/) X-Archive-Number: 201111/1720 X-Sequence-Number: 199204 On 11/30/2011 07:27 AM, Jan Urba=C5=84ski wrote: > On 30/11/11 13:07, Joel Jacobson wrote: >> Hi, >> >> As you know, LISTEN/NOTIFY is broken in the Java client library. You=20 >> have >> to do a SELECT 1 in a while-loop to receive the notifications. >> >> http://jdbc.postgresql.org/documentation/head/listennotify.html >> >> Is there some other library with a proper implementation where you don= 't >> have to spam the database with queries to get the notifications? > > You mean a Java library? If Java is not a requirement, the psycopg2=20 > Python library supports notifies well. > > ... and probably most libraries that (unlike JDBC) are libpq-based, like=20 the perl DBD::Pg. cheers andrew From joel@gluefinance.com Wed Nov 30 20:13:47 2011 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4CFA3A0109D for ; Wed, 30 Nov 2011 16:13:47 -0400 (AST) Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVqXK-0006AW-HU for pgsql-hackers@postgresql.org; Wed, 30 Nov 2011 20:13:47 +0000 Received: by lagw12 with SMTP id w12so277222lag.19 for ; Wed, 30 Nov 2011 12:13:33 -0800 (PST) Received: by 10.152.102.173 with SMTP id fp13mr2583224lab.24.1322684013136; Wed, 30 Nov 2011 12:13:33 -0800 (PST) Received: from [10.19.25.145] (c-5eeaaa2a-74736162.cust.telenor.se. [94.234.170.42]) by mx.google.com with ESMTPS id ni5sm2867355lab.3.2011.11.30.12.13.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Nov 2011 12:13:30 -0800 (PST) References: <4ED62127.8050902@wulczer.org> In-Reply-To: <4ED62127.8050902@wulczer.org> Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Message-Id: <357670BB-E029-4C33-AE60-5FFD5C9571A0@gluefinance.com> Cc: "pgsql-hackers@postgresql.org" X-Mailer: iPhone Mail (8J2) From: Joel Jacobson Subject: Re: Java LISTEN/NOTIFY client library work-around Date: Wed, 30 Nov 2011 21:13:25 +0100 To: =?utf-8?Q?Jan_Urba=C5=84ski?= X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201111/1754 X-Sequence-Number: 199238 On 30 nov 2011, at 13:27, Jan Urba=C5=84ski wrote: > On 30/11/11 13:07, Joel Jacobson wrote: >> Hi, >>=20 >> As you know, LISTEN/NOTIFY is broken in the Java client library. You have= >> to do a SELECT 1 in a while-loop to receive the notifications. >>=20 >> http://jdbc.postgresql.org/documentation/head/listennotify.html >>=20 >> Is there some other library with a proper implementation where you don't >> have to spam the database with queries to get the notifications? >=20 > You mean a Java library? If Java is not a requirement, the psycopg2 Python= library supports notifies=20 I need a Java-library for this >=20 > Cheers, > Jan From books@ejurka.com Thu Dec 1 00:55:31 2011 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9CBB019F7A75; Wed, 30 Nov 2011 20:55:31 -0400 (AST) Received: from mail63.csoft.net ([205.205.214.4]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVuvw-0004xO-8z; Thu, 01 Dec 2011 00:55:30 +0000 Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 04B3C28409; Wed, 30 Nov 2011 19:55:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=rjpPpFnHucrTR/5R3w+t062kjoI=; b=wBMOt/ +mEJnEup0i1H2rI+DiAJW17htJ5FE2mr131VNdStiqOZ8LPv4Uvdbt4OQnwDpxq5 TFt0Rr3wdx71UzmNpeoFYJ1Ork8Clevp/n2HURf2a8bupPnw324elj8Ho1rOIrmM glxybyXB/dnnwqx0lrvQBEVeykH430a/4RK74= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id ABF982841F; Wed, 30 Nov 2011 19:55:14 -0500 (EST) Received: by leary.csoft.net (Postfix, from userid 1112) id 12251A20C; Wed, 30 Nov 2011 19:55:14 -0500 (EST) Date: Wed, 30 Nov 2011 19:55:13 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Joel Jacobson cc: pgsql-hackers@postgresql.org, pgsql-jdbc@postgresql.org Subject: Re: Java LISTEN/NOTIFY client library work-around In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201111/1767 X-Sequence-Number: 199251 On Wed, 30 Nov 2011, Joel Jacobson wrote: > As you know, LISTEN/NOTIFY is broken in the Java client library. You have to > do a SELECT 1 in a while-loop to receive the notifications. > > http://jdbc.postgresql.org/documentation/head/listennotify.html This documentation is out of date. Currently you can get notifications without polling the database if you are not using a SSL connection. You still must poll the driver, using PGConnection.getNotifications, but it will return new notifications received without an intermediate database query. This doesn't work over SSL and potentially some other connection types because it uses InputStream.available that not all implementations support. Kris Jurka From joel@trustly.com Thu Dec 1 12:21:54 2011 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E4595914534; Thu, 1 Dec 2011 08:21:54 -0400 (AST) Received: from mail-yx0-f174.google.com ([209.85.213.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RW5eD-00052u-D6; Thu, 01 Dec 2011 12:21:54 +0000 Received: by yenl6 with SMTP id l6so1591481yen.19 for ; Thu, 01 Dec 2011 04:21:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.116.14 with SMTP id o14mr1567193anc.106.1322742099944; Thu, 01 Dec 2011 04:21:39 -0800 (PST) Received: by 10.236.108.37 with HTTP; Thu, 1 Dec 2011 04:21:39 -0800 (PST) In-Reply-To: References: Date: Thu, 1 Dec 2011 13:21:39 +0100 X-Google-Sender-Auth: lDh2NZid42427FSGzz8fJVS0wys Message-ID: Subject: Re: Java LISTEN/NOTIFY client library work-around From: Joel Jacobson To: Kris Jurka Cc: pgsql-hackers@postgresql.org, pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016e642d2ccff267f04b306e459 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201112/78 X-Sequence-Number: 199330 --0016e642d2ccff267f04b306e459 Content-Type: text/plain; charset=ISO-8859-1 2011/12/1 Kris Jurka > > > On Wed, 30 Nov 2011, Joel Jacobson wrote: > > > As you know, LISTEN/NOTIFY is broken in the Java client library. You > have to > > do a SELECT 1 in a while-loop to receive the notifications. > > > > http://jdbc.postgresql.org/documentation/head/listennotify.html > > This documentation is out of date. Currently you can get notifications > without polling the database if you are not using a SSL connection. You > still must poll the driver, using PGConnection.getNotifications, but it > will return new notifications received without an intermediate database > query. This doesn't work over SSL and potentially some other connection > types because it uses InputStream.available that not all > implementations support. > I know it works without SSL, but we need SSL for this. If it would be possible to fix it, my company is as I said willing to pay for the cost of such a patch. > > Kris Jurka > -- Joel Jacobson Trustly +46703603801 https://trustly.com --0016e642d2ccff267f04b306e459 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2011/12/1 Kris Jurka <books@ejurka.com>


On Wed, 30 Nov 2011, Joel Jacobson wrote:

> As you know, LISTEN/NOTIFY is broken in the Java client library. You h= ave to
> do a SELECT 1 in a while-loop to receive the notifications.
>
> http://jdbc.postgresql.org/documentation/head/liste= nnotify.html

This documentation is out of date. =A0Currently you can get notificat= ions
without polling the database if you are not using a SSL connection. =A0You<= br> still must poll the driver, using PGConnection.getNotifications, but it
will return new notifications received without an intermediate database
query. =A0This doesn't work over SSL and potentially some other connect= ion
types because it uses InputStream.available that not all
implementations support.

I know it work= s without SSL, but we need SSL for this.

If it wou= ld be possible to fix it, my company is as I said willing to pay for the co= st of such a patch.
=A0

Kris Jurka



--
Joel Jacobson
Trustly
+46703603801
https://trustly.com


--0016e642d2ccff267f04b306e459-- From mmoncure@gmail.com Fri Dec 2 16:16:32 2011 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id D9780DDBC2A; Fri, 2 Dec 2011 12:16:32 -0400 (AST) Received: from mail-yx0-f174.google.com ([209.85.213.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWVmo-0007Wf-AC; Fri, 02 Dec 2011 16:16:32 +0000 Received: by yenm1 with SMTP id m1so389622yen.19 for ; Fri, 02 Dec 2011 08:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=A74wrT94XfAe2BNGW36SMMdIOyUkac5q57dPPfnASWs=; b=A1W6hpLjdbHQGDiP0Qf6XwxjlIenAR71gb1XNIOQ/gh1g1/fBcOoRIxCMaZjLf8q7I w12KUym/OBBedV5vc7o0relR5Fwbasj0RqRg4GACEvvHvxsOlck+hqa6OF+47D0JLUrO dhdVTbwuFfNY7lmf78C+FKYBjajclR3YlCF50= MIME-Version: 1.0 Received: by 10.236.161.193 with SMTP id w41mr19910226yhk.93.1322842577256; Fri, 02 Dec 2011 08:16:17 -0800 (PST) Received: by 10.236.22.5 with HTTP; Fri, 2 Dec 2011 08:16:17 -0800 (PST) In-Reply-To: References: Date: Fri, 2 Dec 2011 10:16:17 -0600 Message-ID: Subject: Re: Java LISTEN/NOTIFY client library work-around From: Merlin Moncure To: Joel Jacobson Cc: Kris Jurka , pgsql-hackers@postgresql.org, pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201112/80 X-Sequence-Number: 199332 On Thu, Dec 1, 2011 at 6:21 AM, Joel Jacobson wrote: > 2011/12/1 Kris Jurka >> >> >> >> On Wed, 30 Nov 2011, Joel Jacobson wrote: >> >> > As you know, LISTEN/NOTIFY is broken in the Java client library. You >> > have to >> > do a SELECT 1 in a while-loop to receive the notifications. >> > >> > http://jdbc.postgresql.org/documentation/head/listennotify.html >> >> This documentation is out of date. =A0Currently you can get notification= s >> without polling the database if you are not using a SSL connection. =A0Y= ou >> still must poll the driver, using PGConnection.getNotifications, but it >> will return new notifications received without an intermediate database >> query. =A0This doesn't work over SSL and potentially some other connecti= on >> types because it uses InputStream.available that not all >> implementations support. > > > I know it works without SSL, but we need SSL for this. > > If it would be possible to fix it, my company is as I said willing to pay > for the cost of such a patch. I certainly don't want to discourage you from cleaning up the jdbc ssl situation, but one workaround might be to use stunnel. merlin