Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRZUM-002DSk-6P for pgsql-jdbc@arkaria.postgresql.org; Thu, 03 Aug 2023 14:39:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qRZUJ-00ECr3-Da for pgsql-jdbc@arkaria.postgresql.org; Thu, 03 Aug 2023 14:39:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRZUJ-00ECqs-53 for pgsql-jdbc@lists.postgresql.org; Thu, 03 Aug 2023 14:39:39 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qRZUG-000MBC-EQ for pgsql-jdbc@postgresql.org; Thu, 03 Aug 2023 14:39:38 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b9338e4695so16035401fa.2 for ; Thu, 03 Aug 2023 07:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691073575; x=1691678375; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jtoq9RkirD61aSX+6MZFt2RUoE1hRuBYbND7QnqjlCI=; b=mXE+gAWfr6pT4PBQqqpF7tNW9p1nRYbPb2Y5UZbPOaKbH3ViDDGHAWQip/qt16URcG 9ViCJVedxQCzmrxb+txh8nX69OtQLOe9budE5zeb6GVYLsMvY9JonOukpowwfpLI6LAI QR0PUyVaaZddyNcBKYEZyf2+1Jz/mK80i9d6qYVvjB215dZBCJcL668ZSvIiNqPqi2Dj Rw9WNq9TGo4iMDq+vV3EpWnnfvXl0Uv7v6/wRw087eJzw/sfWqlddBwVxTbc+N6vw1lU pFm28qQXNDOtGz0DWYBRjby87jCQX4hyx/dVPkMBPs1lOw7PMZRpdZV/k89sp+hIT/Uo 0ifQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691073575; x=1691678375; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jtoq9RkirD61aSX+6MZFt2RUoE1hRuBYbND7QnqjlCI=; b=RM8GuuKLKjRyQikYqURyZNEGDz2pzcMbkxtAZk/cMuuURzMS1emy71crUuofFJBL5y pldgzuoIjx69c/WZTuvqXOmw3kkZV69lHQCAyvR4+TdQlVGMKJGe2wHUYXxRUHqIvPzx vE5xWQb81jU68ANy0yl7MnMFguAaqTVHmpUhC78qJGn3ibtWMCiQ0hCSsYNkBy7CWbLD cvvP5ACcngotI4LQkuCJF/zr05S/oo8bWqrtAFr+mvyT37Z3HXjoocIBasoUDlHBIMhL mdSnMmcadiRXqlRvbz59+yL8Pn8CCfxh/g13ZFe2SGgLh+1yNVNhVxAgDdmxCBE4iuYZ oVFQ== X-Gm-Message-State: ABy/qLZSBFTGjcLRDBGysQQz13ijvpb/xwzCSxQGh0R+iewYQ3b343gr UlUtOz0Tm3S1beyxtaMx8Hy6MnxGZOszUBNbZKMiSAAr X-Google-Smtp-Source: APBJJlHySMW1vILnM2GUjsC3tw4q6sHaO8+aH6qjI0KzIeXp2Ak74NGwSncWi7lLxttAYed5wW/qDesrUVgJj4ksaRA= X-Received: by 2002:a2e:8546:0:b0:2b6:e618:b5a0 with SMTP id u6-20020a2e8546000000b002b6e618b5a0mr7780189ljj.6.1691073574947; Thu, 03 Aug 2023 07:39:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pawel Veselov Date: Thu, 3 Aug 2023 16:39:18 +0200 Message-ID: Subject: Re: PGConnection.getNotifications(0) doesn't block To: List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello. On Thu, Aug 3, 2023 at 4:04=E2=80=AFPM Pawel Veselov wrote: > > Hello. > > I'm implementing a bit that is expected to wait for published channel > notifications, > and once there are any - process them. > > I'm using PGConnection.getNotifications(0), but that immediately > returns an empty > array, and doesn't block like JavaDoc says it should. > > I'm on 42.6.0. > > What am I missing? The transaction state is not IDLE, that's what's missing. But JavaDoc doesn't mention that bit.