Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hz2Tz-0002wZ-Rq for pgsql-general@arkaria.postgresql.org; Sat, 17 Aug 2019 17:27:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hz2Tx-0005u7-FT for pgsql-general@arkaria.postgresql.org; Sat, 17 Aug 2019 17:27:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hz2Tv-0005t7-CE; Sat, 17 Aug 2019 17:27:13 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hz2Tr-0005vE-TV; Sat, 17 Aug 2019 17:27:10 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 680FA20E94; Sat, 17 Aug 2019 13:27:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 17 Aug 2019 13:27:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=v 4ITQULbsrhLVpj+MK5fur8TQtfWtTeSDH5Kx52begk=; b=RED3lhHsyqELbOvsc 8m37rJ1A3m40x7TYXRoB7Rz1ZLb5ONDckv0b/8VEAGNz7RzHzauLbds/bOA7J7Xk TDbYHdC5BzEzFw8BUGdvb8qmJL9df87PyWyrm4xs2u35F0zk+lgTx83YwD3LosIi RUUi2NfLsY2coyMWzhiy7ozjaCIJyqGTORHGT4Tvrw7bhrpBxCl99zUVMSRBpIbq YpwgFk3iM8F8fTSta5m2KCxgezTZ7Jg3UTh5WNKmUaeZlF1VZ+YuYakhjOMaHeY7 aj2wEhKRTYuK5sn20snQm1a6Kms7vZLoGfRtZOiIFyAavzvfbBTQ4XxX9ccNY4sQ 8lGcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=v4ITQULbsrhLVpj+MK5fur8TQtfWtTeSDH5Kx52be gk=; b=o9DPIESqz3wp9vnAMyqrM4swRmlevgz/jHu5uEBw/8OYK1I3qAmJRGyDF ObrDjsB173VMU8khq3vxAucfT4JD6rAfdRcN6IKMqmQD+thD5aas9I7lsGBiiTDj NrVSIIjCglD7TAFaqw45irfhs1+vhURuekMjZcXWjP7QnYonDvyspCEsuTWrKwU2 YrFTNOtfF/PJOKqgaOavFkf108htJZiJ+jMRCozFjyo7gQAq0YmUbNxtdOcyG9YP z8WSselTBJTtW2tpGyuN6qgzuUDf5Ml+96aiXcDv6bt/N/F4Tgqk8LXt/e1HjfEw e1AJyHGu8BjiNXB62DaD42PrjxiSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudefhedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjedurddv uddvrdduhedtrddvtddvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkh hlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 5E82280059; Sat, 17 Aug 2019 13:27:05 -0400 (EDT) Subject: Re: Transaction state on connection Idle/Open/Failed To: David Wall , pgsql-general@lists.postgresql.org, pgsql-jdbc@lists.postgresql.org References: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org> From: Adrian Klaver Message-ID: <4de2983b-605c-67ff-df3b-420d06f2aa30@aklaver.com> Date: Sat, 17 Aug 2019 10:27:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <07cb7902-20a3-b139-096d-cdfffca7d3cd@computer.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/16/19 12:57 PM, David Wall wrote: > In JDBC (latest version), I'm using the > org.postgresql.jdbc.PgConnection.getTransactionState() that returns an > enumeration of IDLE, OPEN or FAILED. > > I am familiar with IDLE, meaning the connection has a new transaction > started, but isn't doing anything.  We think of this as the "normal" > state for our connections. > > How does OPEN compare to IDLE?  If we stop using a connection that's in > the OPEN state, is something wrong?  That is, does it have pending > updates that require a commit/rollback? > > Same for FAILED.  If we no longer need a connection in the FAILED state, > is something wrong?  Does it have pending updates that require a > commit/rollback (assuming in this state rollback makes more sense). > > I'm really trying to find out what it means for the connection to be in > OPEN or FAILED states compared to IDLE. https://jdbc.postgresql.org/development/privateapi/org/postgresql/core/ProtocolConnection.html > > Thanks, > David > > > > -- Adrian Klaver adrian.klaver@aklaver.com